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:

1
2
3
4
5
6
7
<script> 
   Call the standard GA loader script
</script>
<script>
   1. Track the pageview into the individual account
   2. Track the pageview into the roll-up account
</script>

The actual JavaScript is as follows:

1
2
3
4
5
6
7
8
9
10
11
<script type="text/javascript">
   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"));
</script>
 
<script type="text/javascript"> 
   var firstTracker = _gat._getTracker("UA-123456-1");
   // Acc. for mysite.com firstTracker._trackPageview();
   var secondTracker = _gat._getTracker("UA-987654-1");
   // Acc. for catch-all secondTracker._trackPageview();
</script>

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):

1
2
3
4
5
6
7
   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…

Roll-up implications

It is important you are aware of the ramifications of rolling up data from different websites into one Google Analytics account:

  1. Pageview aggregation
    Pageviews in your different websites that have the same page title or name (for example index.htm, contact.htm etc.) will be aggregated. That is you will only see one entry for index.htm and for contact.htm etc., with the sum of their pageviews. Generally for roll-up reporting that is not a problem as this account is used to get the "big picture" aggregate overview. However, if you still need the page name detail, apply the filter described in the following Help Centre – its the same filter for differentiating pageviews from sub-domains .
  2. transaction in different currencies
    Similar to pageview aggregation, e-commerce data will be aggregated. That is, if you have transactions in different currencies the revenue totals become meaningless at the roll-up level. So pounds, dollars, euros are all be combined regardless of exchange rates. Therefore, for your roll-up account, unify your transaction data into a single "base" currency. This base currency should remain fixed so that long term comparisons can be made i.e. don’t change this to reflect currency exchange rates.
  3. Timezone alignment
    If your stand alone accounts operate in different timezones, ignore time of day reports in the roll-up account. They won’t make sense!
  4. AdWords ROI in different currencies
    If you run AdWords accounts in different currencies for your stand alone Google Analytics account, ignore the ROI and margin metrics from the ‘Clicks’ report.
  5. Cookie manipulation
    The roll-up report method described in this post results in cookies being shared between both of your Google Analytics accounts. Therefore any cookie manipulation on one (changing time out values, expiry date for example), results in changes impacting both sets of reports. This issue can arise for example if you have an agency collecting data for its own internal purposes (stand alone account) as well as for you (global account). They may wish to experiment, not realising the wider impact – I have seen this happen and a great deal of time and money was wasted trying to figure out what was going on!

These implications may sound daunting but in many cases they are not. Apart from unifying your e-commerce data, you probably will not drill down deep enough in a roll-up report for these implications to be noticed.

Improvement tip

This hack improves the pageview aggregation implication described above (item 1).

If you have dozens or even hundreds of product micro sites, you may wish to simplify pageview reports even further. Rather than collecting detail of every single page on each micro site into the rollup account, you can concertina this in to a "per site view". That is, rollup pageviews.

In this way, instead of having pageA = 3 views, pageB = 2 views, pageC = 1 view etc., you would have pageview for www.mysite.co.uk = 6, www.mysite.com = 13 etc. This simplifies the Top Content report, so that you see overall pageview volumes on a per site basis.

The following GATC modification can be used for simplifying pageview reports:

1
2
3
4
5
6
7
8
9
10
<script type="text/javascript">
 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"));
</script>
 
<script type="text/javascript">
 var firstTracker = _gat._getTracker("UA-123456-1"); // Acc. for mysite.com
 firstTracker._trackPageview(); 
 var secondTracker = _gat._getTracker("UA-987654-1"); // Acc. for catch-all
 <strong>secondTracker._trackPageview(location.host);</strong>
</script>

The highlighted line replaces the pageview name (URI) with the name of the website.

Please let me know if you found this article useful. A quick rating (click the stars) is the fastest way, though as always comments are my main KPIs.