flacoste
Forum Replies Created
-
Is the “Add _setAllowLinker” checked?
And yes, the domains should only be the domain itself (www.example.com, not https://www.example.com).
Hello again,
Actually, that change shouldn’t be applied after all. return false; is required because otherwise, the normal URL will be used by the browser, and this one doesn’t include the additional parameters containing the cross-domain tracking information.
I’m not sure why the link weren’t working initially for me, but I reverted my change and everything seems to work now.
So in short, 4.3.3. should work correctly for muli-domain tracking once configured.
Hi Jeff,
I installed 4.3.3 and got it to work for my site.
For configuration, in the “Advanced Settings”, I’ve checked “Enable Cross Domain Tracking”. And then I put my main domain in “Cross-Domain Tracking, Primary Domain:”, and added my other domains (external e-commerce site) in “Cross-Domain Tracking, Other Domains”.
If you are logged in as administrator when viewing the site, I think by default it won’t add the “_link” thing. (No analytics at all at that user level unless you change the “Ignore users” settings.
If you log out or you use an “incognito window” in Chrome, you’ll probably see the proper analytics code added.
There is one bug though. The link to the other domains won’t work. If you click on them, nothing will happen (they will be recorded though). The reason is because the onClick handler ends with “return false;” which means, don’t follow the actual link.
I fixed that by changing file
google-analytics-for-wordpress/frontend/class-frontend.php
Look for:
if ( isset( $this->options['trackcrossdomain'] ) && $this->options['trackcrossdomain'] && in_array( $target["host"], $crossdomains ) ) { $trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']); return false;"';
And change the
$trackBit
line to:$trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']);"';
(Simply remove the
return false;
part.Everything works great after that.
Cheers