Join Corey Koberg for an in-depth discussion in this video Combining data from multiple accounts into a dashboard, part of Google Analytics Tips.
- I received a question recently about how to combine data from multiple Google Analytics accounts into a single view. And this is one of the most often requested features, going back pretty much to the birth of the product, and there are a few ways to do it. Some are easy, some less so. It all depends on what you want to accomplish, how comfortable you are with code, and whether or not you need historical data, or just from this point forward. Now, for those of you who are Google Analytics premium customers, looking to combine data from multiple web properties, you're in luck, because there's now a way to create a roll up report that will combine that data for you in an intelligent way right there in the interface.
But, since most of you are not premium customers, we'll take a look at another way in this tip that builds on a previous tip, and also pulls historical data as well. For example, let's say that you just merged with another company, and you both have longstanding Google Analytics accounts. You're responsible for rolling up symetrics regarding the reach of the new, combined entity. You certainly have many ways to do this, but an extremely simple way is to leverage the built-in Google spreadsheet imports, like we saw in an earlier tip, but instead of using a single account for this, we're gonna pull from multiple accounts.
Let's take a look at what I mean by that. Come here to Google spreadsheets, and we're gonna start a new spreadsheet. Okay, you may remember that what we used last time was this Google Analytics Add-on here. You can go ahead and add that if you don't have it already. We're gonna Create a New Report. It may say that you need to upgrade, that's fine. Now you may remember, I don't really care what we put in here, we're gonna, basically, fix this in the next one. But, we can go ahead and name this, say, Combined.
Come down here, again we can select any Metrics and Dimensions that we want. In our case, let's select Sessions and, maybe, Page Views. For Dimension, let's look at User Type. It's gonna be whether they're new versus returning, just for example, and create the report. So, we've go our report here. Let's modify this a bit. I wanna go with the last 30 days. And in our case, I wanna do a Sort by User Type as well. We're not gonna put any Filters on this time, and we don't need to worry about Max Results or anything else.
But what I do wanna do, is put another one on here, that's going to be coming from a different account. And if you recall from last time, I can simply add more columns on here to create more reports. So, let's go ahead and copy this over, except I want to change the View ID here. So, if we're calling this one, they're calling it Combined, let's say this is the OldCompany, and this is the NewCompany, keep these straight. And I need to get this Profile ID. Now, I could go and create another spreadsheet, and I could do it just like I did there, or I can come up here, and I can use the Query Explorer for the API, and remember, that's going to give us our ID.
So I can come down here, maybe I'll select my test profile, and just grab this ID right here, and I can pop that right in there. Okay, so quickly recapping, what I've got here are two columns. It's going to go, and it's going to hit the API to pull back all the data for this particular ID, this Profile, which is coming from the account of the OldCompany, and then it's going to do the exact same thing for this column, here, from the NewCompany. So, if I come up here and Run this report, we'll do just that.
Okay, we've got two reports completed successfully. It's created two different tabs down here, one for the OldCompany, one for the NewCompany. I've got my info here, as far as my New and Returning Visitors, for my sessions and my page views, one for the old, one for the new. And what I can do now is, of course, just create some combined charts here, one for sessions, here, just as an example. Get some kind of stacked bar chart here.
Come back here, maybe I'll grab another. Come here. We can even change the labels here to be a bit more descriptive, call this OldCo. And then we've got the data here for NewCo. And Chart title can be our Sessions. So there we go. We've got a stacked bar chart. We've got data being pulled in from multiple accounts, stacked together.
I can clearly see that OldCo is bringing in significantly more Sessions, here, and I can see what the combined total is for those, as well. Now of course, this is just a simple example. You can choose any Metrics you like. You can choose any segments you like. You can choose any Dimensions you like. You can do all kinds of sophisticated charts. But the key point here is, we've got multiple Google Analytics accounts feeding into the same data set here. So there's our first example of how to pull in these multiple accounts, including historical data, and display it all in one place. You can even chart it out here in less than 10 minutes.