dwyl / learn-google-analytics

:chart_with_upwards_trend: A quick guide to learning/using google analytics for your web app.
73 stars 12 forks source link

How to set up a subdomain on Google Analytics #14

Open Cleop opened 7 years ago

Cleop commented 7 years ago

How to set up a subdomain on Google Analytics. Learning from: http://www.verticalrail.com/kb/filter-in-google-analytics-to-track-subdomains/

See https://github.com/dwyl/tachyons-bootstrap/issues/51#issue-236527191

  1. Add the UA code from your main site to the page/s on your subdomain that you want to track
  2. Create a new view in GA for your subdomain (you will need edit permissions to be able to do this if you're using a company account)
  3. Apply a custom filter to your newly created view to specify that it should only count traffic coming to the subdomain, not the entire domain
  4. That's it! Test it in real-time view by opening your subdomain site in a separate tab to see whether GA is registering your visit.
  5. Amend/ check your existing domain's filter so that you can either include/exclude traffic from your subdomain, depending on your needs.
iteles commented 6 years ago

Would be good to get this into the readme 👍