Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have a number of custom variables set up in google analytics. We'd like to show a table of event occurrences broken down by two custom variables, e.g. if variable one can be A, B, or C and variable two can be J, K or L:

Events |  A  |  B  |  C  |
   J   | 345 |  65 |  12 |
   K   | 234 |  43 |   7 |
   L   | 123 |  21 |   4 |

How do I get the information in that format?

share|improve this question
Just so I understand...There are 2 variables here, one whose values can be A, B, or C, and the second who's values can be J, K, or L. Are you looking for total events, or events with a particular category/action/label? The more specificity you give, the more like I'll be able to help. – Yahel Feb 4 '11 at 16:47
events with a particular category/action/label. – Simon Feb 4 '11 at 18:53

I'm going to assume you want this on your webpage.

Set up your webpage by following the tutorial here:


Then on the section header of "Retrieve Report Data," use this to filter your results:


Let me know how it goes.

share|improve this answer
I actually meant to display this directly in Google Analytics, but thanks. – Simon Feb 4 '11 at 16:03
This takes you on the right track. There's no way to do this in Google Analytics's interface. You need to use the API. – Yahel Feb 4 '11 at 16:45

The Google Analytics API Query Explorer provides a simple interface for querying the Google Analytics API. So, if you're not looking to build an API tool, you can just setup your query in the Query Explorer, and bookmark the permalink it gives you, to easily extract your data.

So, I'm going to build you a sample query that meets this explanation.

Let's say your two variables are stored in the first and second slot. That means we'll set our dimensions to be the values (not the names) of the first two slots.

The metric you're interested in retrieving sounds like its Total Events (but you could also use unique events).

Then, you want to filter the results to be only those that triggered the particular category/action/label combination you want.

The resulting query looks like this:

Dimensions: ga:customVarValue1,ga:customVarValue2

Metrics: ga:totalEvents


The data returned would look something like this: enter image description here

You can try out and customize this query here.

share|improve this answer
Looks good but I can't get past the authentication step. – Simon Feb 9 '11 at 13:27
The authenticate step in the Query Explorer? Try using a different browser. I know sometimes Safari doesn't work. I've had better success in Firefox and Chrome. – Yahel Feb 9 '11 at 14:53
I was using Firefox, but I'll give it a go in Chrome. – Simon Feb 16 '11 at 10:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.