1

Each user on our website has their own subdomain (e.g. bob.example.com, elephant.example.com) and they get paid for the traffic that they send to this subdomain. How can I wire up Google Analytics so that I can view statistics (views, countries, browsers, etc) for each domain seperately? I'm not sure if this is an Analytics JS code thing, or if it tracks already and I am unable to find it in the GUI

My current Google Analytics code is this

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-123456-1', 'example.com');
  ga('send', 'pageview');

</script>

Any assistance would be extremely appreciated, thank you.

3

According to the Google Developers guide, you don't have to set up multiple code snippets for each site, as long as they share the same top level domain:

Google Developer's Guide

Here's a good article on displaying subdomains in the dashboard.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.