Search code examples
javascriptgoogle-analyticsuniversal-analytics

Will a Google Analytics tracking id send data from a different domain?


We're using Google's Universal Analytics. I've created a property with a website address of mywebsite.com and have therefore received the javascript snippet needed to embed in my page. From what I understand this will begin capturing data from this top level domain and subdomains for example, heynow.mywebsite.com. However, in my case it is possible that this snippet will be served in a page that may have a completely different domain like yourwebsite.com. My expectation is I would not see this data in my Google Analytics views. Am I right?


Solution

  • Yes. Referrer spam use this technique to send you "false" events/pages/customDimensions hits to promoted their services. To avoid this, make sure you :

    1. exclude bots traffic (a setting from the view settings.)
    2. include only traffic from your domain and sub-domain using a include filter (property level.)