Table of Contents
Yes, but it requires adding a snippet of code to your theme’s functions.php
file or adding it to a seperate plugin:
function ffwpress_caos_set_cookie_domain($config) {
$config['cookie_domain'] = 'auto';
return $config;
}
add_filter('caos_gtag_config', 'ffwpress_caos_set_cookie_domain');
(Conversion) tracking across subdomains isn’t possible when Snippet Type (Basic Settings) is set to Minimal Analytics.
Is your subdomain not using CAOS/WordPress?
That’s fine! You should just make sure that the generated cookies have the same name.
To avoid ad blockers CAOS has a different cookieName set by default: caosLocalGa
All you need to do is make sure that the cookie generated by CAOS matches the cookie name of the other Google Analytics tracking snippet. The default cookie name for Google Analytics is _ga
.
This code replaces the code mentioned in the previous chapter:
function ffwpress_caos_set_cookie_domain($config) {
$config['cookie_name'] = '_ga'; // Change this to the value your other tracking code uses.
$config['cookie_domain'] = 'auto';
return $config;
}
add_filter('caos_gtag_config', 'ffwpress_caos_set_cookie_domain');