• I was scratching my head trying to figure out why, despite having set the ‘Subdomain Tracking’ value to ‘www.themodernnomad.com’, I was still getting cookies sent to my static domain ‘static-12.themodernnomad.com’.

    After much fiddling around, I found that the plugin adds the _setDomainName call right before the call to trackPageView. However, the _setDomainName has to be the first thing that is called after the setting of the tracking ID. If you have any custom code (which I have) then the result is that you get cookies set both on .themodernnomad.com AND http://www.themodernnomad.com.

    As a workaround, I simply set the ‘_setDomainName’ call manually as the first statement in my custom code. Ugly, yes, but it works now.

    This really should be fixed.

    http://wordpress.org/extend/plugins/google-analytics-for-wordpress/

  • The topic ‘Custom code, subdomains and _setDomainName’ is closed to new replies.