Noise or Music? - The Insights Blog

Roll up reporting in Google Analytics

Categories: Plugins & Hacks / Comments: 52

Share Button

Google Analytics Hack Roll up reporting is not a standard feature in Google Analytics. However with a little extra coding, you can have stand alone reports for specific i.e. product dedicated websites, and a roll-up report to give a global overview.

Generally, this issue mostly effects enterprise clients. For example, companies with brand specific or product specific web sites targeted at particular markets. Because of this specific need it makes sense to have separate, stand alone Google Analytics accounts for each web site. That way, segmentation, referral analysis, e-commerce revenue (or lead generation) can be analyzed in detail.

However, Marketing Managers also need a high level overview of how the entire online channel is performing. This is when having separate GA accounts can become laborious. Roll-up reporting simplifies this. That is, in addition to individual Google Analytics accounts, you also have a single “catch-all” account with all data from all web sites aggregated. This post shows you how to do this and has been successfully deployed by clients such as Unicef, Baby Bjorn, Stena Line and Macmillan Publishing.

What exactly is the advantage of this approach compared to using a single profile and then creating additional sub-profiles for each site?

For enterprise clients I generally come across the scenario where the client has semi-autonomous country offices who wish to “play” (segment, filter, open up access to their agency) with their own specific data. The HQ requires a global overview but wish to leave the country/region details to the local office. In fact, they generally wish to leave all training, support and management of analytics to their local office – HQ provides the implementation.

To ensure HQ receives its global overview with confidence in its data integrity, it is better that they maintain their own GA account with access restrictions and change history documentation in place. Country offices can then do as they wish.

Roll-up reporting setup

The principal to roll-up reporting is straight forward – you add multiple Google Analytics Tracking Codes (GATCs) to your web pages. One specifies the individual account, the other is for the roll-up account. Schematically this is shown below for two websites:

The actual JavaScript is as follows:

Note, for each stand alone web site, you use your specific GATC i.e. change the UA-123456-1 to match each of your Google Analytics accounts. Below this, you add the same same roll-up account information. The rollup part of the GATC remains the same for each site. In this case UA-987654-1. Obviously you will need to change the UA numbers for your account(s).

E-Commerce

Special consideration is required for e-commerce transactions because you will need to call the e-commerce tracking code for each account. So _addTrans, _addItem and _trackTrans are required for firstTracker and secondTracker objects. Schematically you need to add the following on your transaction receipt/confirmation page (view the Help Centre if you need general e-commerce tracking help):

   firstTracker._addTrans(enter transaction values as array);
   firstTracker._addItem(enter item values as an array);
   firstTracker._trackTrans();

   secondTracker._addTrans(enter transaction values as array);
   secondTracker._addItem(enter item values as an array);
   secondTracker._trackTrans();

And that’s it… except… …continue reading ‘Roll up reporting in Google Analytics’

Share Button

Comments

  1. David says:

    Hi Brian

    Love your blog, books and G+ contributions. You tought me a lot!

    But I think you need to do some SEO for this page. I spent hours searching on “analytics multiple accounts eccomerce tracking” before I found it.
    Ask Per, maybe he can help you with titles and stuff ; )

    Anyway, I am happy I found it because I have a case with some 20 different domains with their own Analytics-accounts and we have created a Master-account where we also push in data in order to be able to create overview reports.
    These are not ecommerce websites, but they use ecommerce to register data regarding specific requests from clients.

    Thing is, we haven´t been able to get ecommerce data to show up in the Master-account (_gaq.push([‘b._setAccount’, ‘UA-XXXXXXX-1′]);).

    I see you provide a solution here, but your post is somewhat old and use the old tracking code.
    Does the same method work also for asynchronous code you think?

    I checked your book on the topic also, but couldn´t find an answer quickly.

    Cheers!

  2. David Hoffmann says:

    Hi,
    As alluded to in previous posts, roll up reporting hack does not appear to be a good solution for e-commerce tracking globally, as invariably you are dealing with subdomain and cross domain tracking which I believe I am right in saying can have implications on cookie setting if used in conjunction with a roll up hack. Therefore seems that one account for all global e-commerce sites and a show domain filter in GA to create filtered profiles is the best option as then you can accurately measure a visitor across their e-commerce and payment journey.
    Let me know if you think there is a better way?

    • @David – as long as the cookie settings in both tracker objects are the same, you will be fine with this technique. Of course currencies need to match if revenue is an important roll-up metric. See Chapter 9 of the book.

      You can achieve the same with your approach – its not right or wrong, just different. Which solution best meets your needs is really based on how your organisation is setup and its corresponding website architecture. The technique I describe is aimed at a certain type of organisation i.e. one with distributed, semi autonomous offices/websites.

      HTH, Brian

  3. Matt N says:

    Re: SOnal’s Post – We are getting the same unequal totals…it seems there are certain pages of some of our sites that the rollup account ignores completely…even though the tracking code is injected exactly the same as on all the other pages. And even on smaller/simpler sites…the stats never add up exactly between the two. Is it unreasonable to expect that? Is there a number of things that could throw this off? If so, what? I can’t seem to find articles/blogs on this matter accept for your question. Any help/explanation would be much appreciated.

  4. SOnal says:

    Great post!! I have a question,I have generated a roll up report for 10 website. Is there any way to understand if the implementation is done properly or not??

    If I add the views of these 10 websites manually the sum is not equal to the views which is given in the roll up report??is this okk??

    Thanks

    • @Sonal: This roll-up technique is for semi-autonomous website/offices where it is highly unlikely a visitor will traverse across the different domains. Is that the same for you?

  5. sgk says:

    Great post!! had a question, how to understand which websites are measurecd in google analytics roll up report? Is there any option in the report which gives the list of website it is tracking?

  6. Rory says:

    Does anyone know if this works for a third level report eg

    1) Individual Audi dealer website
    2) Global Roll up account for all Audi Websites
    3) Global Roll up account for all Manufacturer websites (Audi, Ford, Hyundai etc)

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-AAAAAAAA-1′]), //individual market account
    _gaq.push([‘_trackPageview’]),
    _gaq.push([‘b._setAccount’, ‘UA-BBBBBBBB-1′]), //global rollup account for AUdi websites
    _gaq.push([‘b._trackPageview’]);
    _gaq.push([‘b._setAccount’, ‘UA-CCCCCCCC-1′]), //global rollup account for all manufacturer websites
    _gaq.push([‘b._trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

    • Rory: There is no limit to the number of times you can add tracker objects (FWIW, the max I have worked with is 4). Your logic looks good, but the last call should be preceded by “c.”

  7. sonal says:

    > We don’t want to create a new account and want to use the existing
    account to create a roll up report. Is it possible without disturbing the current structure of the account? i can I keep ,both roll up report and usual reports?

  8. James.S says:

    Hi Brian

    I have been trying alot of varents on the roll up code and so far none have worked. I am trying to roll up 3 accounts,changing the UA-AAAAAAAA-1 to the individual accounts UA but keeping UA-XXXXXXXX-1 the same on all 3 sites.

    Could you please have a look at the code below and let me what I am doing wrong.

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-AAAAAAAA-1′]), //individual market account
    _gaq.push([‘_trackPageview’]),
    _gaq.push([‘RollUp._setAccount’, ‘UA-XXXXXXXX-1′]), //global rollup account
    _gaq.push([‘RollUp._trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

  9. jeffrey.w says:

    Hi Brian
    sorry, you are right, i read it wrong as the cookie manipulation part is talking about cookie for two GA accounts..

    Anyway as a thought on Roll-up setup, could you share some thoughts on my setup?
    http://www.webnation.co.nz/blog/google-analytics-account-structure-enterprise-user-setup

  10. Jeffrey: This is a roll-up reporting technique. It is not intended to track visitors that *traverse* different sites.

    For tracking visitors across different domains you need to “link” between sites so that cookies are handed over to the receiving site. This is covered in Ch 7 of the book “Advanced Implementation”.

  11. jeffrey.w says:

    the cookie part is simply wrong,
    based on your set up, domain a.com and domain b.com will have different GA cookies for unique visitors, because just because you are using the same profile ID doesn’t mean the cookies are shared.
    refer to:http://code.google.com/apis/analytics/docs/tracking/gaTrackingSite.html
    and
    http://code.google.com/apis/analytics/docs/concepts/gaConceptsCookies.html

  12. Is this works?

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-AAAAAAAA-1′]), //individual market account
    _gaq.push([‘_trackPageview’]),
    _gaq.push([‘b._setAccount’, ‘UA-BBBBBBBB-1′]), //global rollup account
    _gaq.push([‘b._trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

  13. Zach Luse says:

    Thanks Alex! This appears to be working for me. I’m getting my roll up data in one account and individual site data in the other.

  14. Alex says:

    Actually, reading a bit further on the subject of “One Push, Multiple Commands” http://bit.ly/bjsZE8 it looks like the correct version should be…

    var _gaq = _gaq || [];
    _gaq.push([‘_setAccount’, ‘UA-AAAAAAAA-1′]), //individual market account
    _gaq.push([‘_trackPageview’]),
    _gaq.push([‘b._setAccount’, ‘UA-BBBBBBBB-1′]), //global rollup account
    _gaq.push([‘b._trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript’; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js’;
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

  15. Alex says:

    Hi Brian,

    Great work on the new edition of the book.

    The question I have is similar to Sergey’s & Zach’s.

    The new GA code looks a little different to the example shown in the original post and I wanted to double-check the syntax for roll-up reporting below works.

    var _gaq = _gaq || [];
    //individual market account
    _gaq.push([‘_setAccount’, ‘UA-AAAAAAAA-1′]);
    _gaq.push([‘_trackPageview’]);
    //global rollup account
    _gaq.push([‘_setAccount’, ‘UA-BBBBBBBB-1′]);
    _gaq.push([‘_trackPageview’]);

    (function() {
    var ga = document.createElement(‘script’); ga.type = ‘text/javascript'; ga.async = true;
    ga.src = (‘https:’ == document.location.protocol ? ‘https://ssl’ : ‘http://www’) + ‘.google-analytics.com/ga.js';
    var s = document.getElementsByTagName(‘script’)[0]; s.parentNode.insertBefore(ga, s);
    })();

    Thanks for your help in advance!

  16. Zach Luse says:

    I believe I just found the answer to my question. I think it would look something like this:

    var _gaq = _gaq || [];
    //rollup account
    _gaq.push([‘_setAccount’, ‘UA-XXXXXXXX-1′]);
    _gaq.push([‘_setDomainName’, ‘none’]);
    _gaq.push([‘_setAllowLinker’, true]);
    _gaq.push([‘_trackPageview’]);
    //single domain account
    _gaq.push([‘t2._setAccount’, ‘UA-YYYYYYY-1′]);
    _gaq.push([‘t2._setDomainName’, ‘.mydomain.com’]);
    _gaq.push([‘t2._trackPageview’]);

  17. Viv Lonsdale says:

    Has anyone got any tips/guides on how to do rollup reporting in GA using the new asynchronous tracking code?

  18. Jagannathan says:

    Hi,

    I have set up rollup profiles for my sites. But there is a mismatch between the data of Individual and roll up profiles. Though the difference between the individual and rollup account for a page is maximum 10 per day..The problem arises when we gather data for over a period of time.

  19. Niklas says:

    Im using the regex you mention in this post

    Filter Type: Custom filter > Advanced
    Field A: Hostname
    Extract A: (.*)
    Field B: Request URI
    Extract B: (.*)
    Output To: Request URI
    Constructor: $A1$B1

    This allows me to see my sub domain which is good. However this also has the effect that I now see www. which is logical since it’s a sub domain. My question. Is there a way to filter out the www so it reports together with the non-www site.

  20. Ryan says:

    Hi Brian, really helpful post. I’m utilizing the code you’ve supplied for tracking a country and a global account with the modification that can be used to simplify reports. When tracking multiple top level domains, Google recommends adding the following code snippets. Should we add the following code beneath var Firsttracker and var secondtracker?

    pageTracker._setDomainName(“none”);
    pageTracker._setAllowLinker(true);

  21. Jon says:

    Thanks Brian, great post! I’ve implemented this across a few sites, and I’m a little unsure as to how to interpret the Absolute Unique Visitor data.

    Will the roll up be able to de-dupe visitors across the different domains included within it?
    e.g. If one visitor browses 4 of our sites in a day, will they be counted as 4 unique visitors, or 1 unique visitor in the roll up?

    Is there an issue with cookies preventing this from happening?

    Any info would be greatly appreciated!

    • Jon: The method for roll-up reporting I describe is not suitable for your situation – it is aimed at organisations that have autonomous offices/websites.

      For visitors that can traverse different websites, you need to use the methods described in Ch7 of the book, Advanced Implementation. Essentially you hand over cookies from one domain to another (using _link or _linkByPost functions) so that the session information is preserved. That way, the uniqueness is also preserved.

      BTW, this post from me is also relevant for you: http://www.advanced-web-metrics.com/blog/2009/02/11/why-counting-uniques-is-meaningless. It doesn’t mean don’t use ‘uniques’ in your KPI mix, rather use them in context i.e. don’t give a lot of weight to them.

  22. Parthi says:

    Great info! I have a question:How can different events (through ajax requests) in a page be used to create a consolidated report? For example, there are three events (ajax requests) that we want to rollup based on a day and give the metrics for all the three events on the columns. Not sure if the question is clear; if not I can further explain. Help in this regard would greatly help!!

    • Parthi: I don’t think your question relates to this post on roll-up reporting. It sounds like you with to group your ‘actions’ into ‘categories’. Event tracking can do this for you. You will need to plan the hierarchy of your events and then use the category label of the _trackEvent call.

      The current book is a little out of date now on Event Tracking as it was only just in beta when written. The new edition is much more clear on this. Stay tuned…

  23. Great information! It seems like I learn something new everyday with regard to Google Analytics. Learning how to track the information in more granular ways definitely adds value to the information received.

  24. Jesse says:

    Great post! Two things:
    – Roll-up reporting is hitting the big time with a post on the official blog: http://analytics.blogspot.com/2009/09/advanced-structure-your-account-with.html

    – Re: simplifying pageview aggregation — seems like a great fix, but rather permanent. Is there a way to do this via filters on a specific profile in your roll-up account?

  25. The post is nice.

    This is new thing to learn in Google Analytics.

    Thanks

  26. Sergey says:

    Hi, Brian,

    reading you book atm. Since it was published GATC seems to have changed a bit. Now it looks more like:

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var pageTracker = _gat._getTracker(“UA-########-#”);
    pageTracker._trackPageview();
    } catch(err) {}

    Is it the right way to setup tracking for multiple accounts?

    var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
    document.write(unescape(“%3Cscript src='” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));

    try {
    var firstTracker = _gat._getTracker(“UA-########-#”);
    pageTracker._trackPageview();
    var secondTracker = _gat._getTracker(“UA-########-#”);
    pageTracker._trackPageview();
    } catch(err) {}

  27. Hi Brian,

    This has been a big help in seeting our roll up accounts. We will be implementing this very soon on our websites. Just a quick question: Do you see any impact in website performance due to this multiple track code?

    Thanks,
    Vishal

  28. Anupama says:

    Great Post! This is a much better solution than the usual multi-filter method to separate individual website data.

  29. Sam Eaton says:

    Hi Brian,

    I have an enterprise client with GA accounts set up for 5 currencies ($US, GBP, $CA, $AUS, EUR), which track into a roll-up account (in GBP). Is it possible to apply a pre-defined exchange rate (e.g. £1 always equals $1.4) so that the second trackers translate the $/EUR figure, etc, into GBP for the roll up report. Hope that makes sense.

    Thanks, Sam

  30. Luc Peeters says:

    Very interesting article: I am dealing with a couple of enterprise customers who have several sites and a roll-up report is required. But what exactly is the advantage of this ‘double tagging’ approach, compared to using 1 single GA profile tag – and then creating additional sub-profiles for each site, using a filter based on host name ?

    • BClifton says:

      Luc: Good question – this should be made clearer in my original post…

      For enterprise clients I generally come across the scenario where the client has semi-autonomous country offices who wish to “play” (segment, filter, open up access to their agency) with their own specific data. The HQ requires a global overview but wish to leave the country/region details to the local office. In fact, they generally wish to leave all training, support and management of analytics to their local office – HQ provides the implementation.

      To ensure HQ receives its global overview with confidence in its data integrity, it is better that they maintain their own GA account with access restrictions and change history documentation in place. Country offices can then do as they wish.

      Finally, using multiple accounts allows you to overcome the 50 profile limit per account.

      HTH.

  31. BClifton says:

    Emiel: Thanks for the heads up – its actually a bug in WordPress. If I edit a post containing sample code it must be done in HTML view. The wysiwyg editor messes the code and effectively wipes it..!

  32. Emiel Kamzol says:

    Hi Brian, As usual very interesting post.. There is only one but, I don’t see the modifications I just see;

  33. Jay says:

    Doesn’t Google disregard tracking multiple domains with one GA account. See the last paragraph – http://code.google.com/apis/analytics/docs/concepts/gaConceptsCookies.html

  34. Mikhail says:

    Dear Brian,
    Thank you for your book “Advanced Web Metrics with Google Analytics”, we expect it’s translation into Russian to be greatly useful for our colleagues. In Russia Web Analytics is not widely used yet.
    The conference “Сybernetics and Business” is the most large-scale in Russia (5963 participants are registered at the moment, while the registration will be continued for a week http://ok2009.ru/participants/). Dmitry Medvedev, Russian president, visited it last year.
    Some best Russian experts are to make their reports at the conference on the subject “The usage of web-analytics data for increasing sales of an online-shop” (http://ok2009.ru/program2/58/).
    We would be glad if you agreed to be a reporter at the conference (on-line via skype or personally). It will be quite soon, though the date and time are not fixed yet. Anyway, any your report to the audience, including the announcement of the Russian translation jf the “Advanced Web Metrics with Google Analytics” will be discussed at the section.
    A Russian association of Web Analysts is likely to take it’s origin at this section.
    Alexey Yakovlev, the author of two popular Russian-language books on site promotion and context advertising, the leader of the well-known in Russia project http://www.seo-study.ru/, organizes free on-line seminars at http://www.onlinesem.ru/.
    For example, a series of seminars is to take place soon. The seminars are devoted to the problems of usage of Google products and are supported by Google-Russia Company (http://www.onlinesem.ru/google.php). A seminar “Tracking with Google Analytics” will take place on 24 June 2009. Every participant would welcome you to take part in the seminar. If you would choose to make the report via Internet, Alexey Yakovlev could organize the translation into Russian.
    We hope that you will accept our offer.
    Once again thank you for your book.
    Mihail

  35. Nikki Rae says:

    Hi Brian
    I have implemented this on a group of sites that we run and am loving the insightful reports that I can gain. Thanks for this one.

    Nikki

  36. Eric Sender says:

    Hi Brian,

    I have a quick question for you and I’m not sure where to put it, so I thought I’d leave it here.

    How would I set up a filter that would distinguish Google Product Search referrals or plain old Google Organic?

    Its a bit unclear what the specific URL Referral is of a product search link, but I am pretty sure it is just getting counted as organic.

    I am in a situation where it would not be simple to tag all product feed links with ?utm_source parameters, so hopefully a filter will help me out here.

    Thanks!
    Eric

  37. Andre: Well spotted and corrected. Many thanks.

  38. Hi Brian, you have to leave out the quotes around location.host 😉 Thanks for the idea though, great way to do roll-up reporting.

  39. Jared: Thanks for the feedback and good point for extending location.host method.

    Manuel: As cookies are being shared only one instance of setVar can be used.

    On a related note, if the site is running any kind of extension script to track downloads, outbound clicks, etc… or events, they will need to have those scripts also run the second tracker if they want to roll-up that data. Thanks to Caleb of AnalyticsPros for pointing this out.

  40. Manuel says:

    Hi Brian,

    thanks for your explanation, great! like always.

    Just, one question. It would be possible to use a different setVar for each tracker? Thanks.

    Regards

  41. Jared Huber says:

    Great post; very straightforward. Clients ask us for this type of customization all the time.

    On the aggregating pageviews point, it’s also possible to use secondTracker._trackPageview(location.host+location.pathname) rather than creating a filter to differentiate the pages.

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

© Brian Clifton 2015
Best practice privacy statement