Search code examples
google-analyticscross-domainanalyticsweb-analytics

How to track hundreds of websites all together with google analytics


I have a Content Management System which let people create websites. the CMS has multiple theme and color schemes which they can choose. Every website created using this CMS has a unique domain (www.abc.com, ww.xyz.com etc).

Product In detail:

I have a website mywebsite.com people can signup there, buy their own domain and create their own website at mywebsite.com. so now they have their own xyz.com website where user can add content from mywebsite.com

All these websites are independent, they just share the same code as they all are using my CMS but they have their own content (pictures, videos, text) I would like to track the statistics of all these websites all together. It is not a problem if a user goes to abc.com and then goes to xyz.com is counted as different session because they are totally different websites and I want google to count them separately.

I want to do this to check how much views my product is getting as whole. which is the best way to achieve this.

Thank you for your time.


Solution

  • What you're after here is what is referred to as a "roll up" account, this is as standard a feature available in Google Analytics Premium (or 360 as it's now known).

    However assuming you don't have the financial resources to drop £100k on a Google Analytics premium account you can achieve similar through double tagging on the same website.

    This is fairly straight forward and you can see Google's documentation on this on the link below: https://developers.google.com/analytics/devguides/collection/analyticsjs/creating-trackers#specifying_fields_at_creation_time

    As an example:

    ga('create', 'UA-XXXXX-Y', 'auto');
    ga('create', 'UA-XXXXX-Z', 'auto', 'rollupTracker');
    
    ga('send', 'pageview');
    ga('rollupTracker.send', 'pageview');
    

    Where UA-XXXXX-Z is your property ID for the roll-up account and UA-XXXXX-Y is your users' default tracking code.

    Note there are a few caveats to using roll-up views:

    • Even with cross domain tracking you could end up with more than one session across domains for the same user (if they landed on site A then separately landed on Site B before clicking back to site A)
    • You could hit the rate limits and sampling limits imposed by Google pretty quicky.
    • You'll need to use either View filters and/or advanced segments to see the statistics of separate websites and this will only exasperate the issue of sampling limitations.

    Detail of the premium Analytics implementation is available over at Luna Metrics: http://www.lunametrics.com/blog/2015/02/03/rollup-data-google-analytics/