Search code examples
google-analyticsreferrals

How to avoid subdomains as self referrals in google analytics?


  • I am having a domain site.com, i want to avoid referrals from the subdomains like new.site.com, used.site.com etc.
    • I used the _gaq.push(['_setDomainName', 'site.com']); but it doesn't worked.
    • can any one help me in this?

Solution

  • There are two possible solutions here:

    1) Use the _addIgnoredRef() method:

    https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiSearchEngines#_gat.GA_Tracker_._addIgnoredRef

    2) Put the same GA code on your other subdomains as well.