Viewing 4 replies - 1 through 4 (of 4 total)
  • 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 $trackBitline to:

    $trackBit = '_gaq.push([\'_link\', \'' . $matches[2] . '//' . $matches[3] . '\']);"';

    (Simply remove the return false; part.

    Everything works great after that.

    Cheers

    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.

    I noticed that you need to add the external domains you want to add exactly as the example, which might be why it didn’t work for me earlier. (I had http, and the url ended with /. In the code it probably adds the / itself.)

    But even though it seems to correctly add the onclick events for me, it still doesn’t add utm-parameters in the url by itself.

    Is it hidden, or just set up wrong?

    Is the “Add _setAllowLinker” checked?

    And yes, the domains should only be the domain itself (www.example.com, not https://www.example.com).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘So… Does cross-domain work?’ is closed to new replies.