Google Analytics by Yoast
Custom code, subdomains and _setDomainName (1 post)

  1. Parakoos
    Posted 2 years ago #

    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.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics by Yoast
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic