Every once and a while there are reasons where you may have some site owners who want individual reports for themselves and then some other entity wants to measure each site against the others. This can often be the scenario in the case of a franchise.
Let’s say we have our BigCompany corporate headquarters with BigCompany franchises located across the country. Well, the BigCompany franchise in Grand Rapids, MI wants its own Analytics profile so it can measure visits, bounce rates, conversion rates, etc. without having to sift through the data from the Portland, OR location. Likewise, the Portland franchise wants to measure its site performance independent from the Grand Rapids location. However, BigCompany headquarters wants a report that shows the performance of ALL franchise locations across the country. This is a great opportunity to create a Google Analytics roll up report through a little Google Analytics hack!
This hack basically would allow someone to roll up the reports from many profiles into one profile. The hack is quite simple once you see it – and then you think, “why the heck didn’t I think of that!?” It’s pretty straight forward and would just require a small change to the Google Analytics Tracking Code (GATC) on each franchise site.
Existing GATC on Franchise Site
Let’s say the GATC on each franchise site looks like this. This is a direct copy from the Google Analytics site:
<span style="font-family: arial">So, with a little change-a-roo, we just add a reference to the other Google Analytics profile. The code would then look like this:</span>
<span style="font-family: arial"> </span>
There, see how easy that was? Now when the GATC executes, it will track the page view to the local franchisee profile, as well as the HQ “roll up” profile!
If page names are the same across all the sites you’ll be tracking in your roll up report, you’ll want to set up a filter in the roll up report to append the domain name and URI. There are a lot of places you can check on how to do that but, for the sake of convenience, I’ve included here from the Google Code site:
Modify your cross-domain profile with a filter to show the full domain in your content reports.
Once you have domain linking established, you will see only the request URI in the content reports, and not the top-level or sub-domain for a given page. So for example, for visits to the following pages:
http://www.example.com/index.phpand another page on
The reports will show:
You will not be able to distinguish which page is from which domain. To show the domain in the page reports, set a filter to include all components of the page URL, as follows:
- In the Profile Settings page, click the Add Filter link.
- Choose Add New Filter and provide the filter a name.
- Choose Custom Filter and select Advanced on the Filter type settings.
- Under Advanced settings:
- FieldA should be set to Hostname
- FieldB should be set to Request URI
- Set the values for both Field A and Field B to
(.*), which is an expression that captures all characters.
- Set the Output To –> Constructor option to Request URI and provide
$A1$B1as the value for that choice.
Your reports will now show:
This will capture the
www.example.comportion of your URL and include that at the beginning of your page URL in the content reports section.
Tracking Across Sites
If you have the situation where you want to track a visitor from BigCompany.com to BigCompanyFranchise.com this is possible – just not with this method. Let’s save that for another post!
Clear as a Bell Summary
The ability to offer roll up reporting is very convenient in some situations. It’s definitely possible with a small GATC hack to push the traffic to two profiles at once!