0
votes

I'm using Google Analytics to track outbound clicks from my website using events (e.g. like these examples). I create events like:

Category: "outbound"
Action: "click"
Label: [The URL that was clicked]

It's working fine - in the API dashboard I can have "Event Label" as the primary dimension, and "Page" as the secondary, and see the number of events.

I want to fetch the same data from the API. But in the API explorer, while I can do this to only get the outbound URLs:

metrics=ga:sessions&dimensions=ga:eventLabel

If I try to also get the page, I get no results:

metrics=ga:sessions&dimensions=ga:pagePath,ga:eventLabel

I feel like I'm missing something obvious (I'm new to the GA API) but I'm not sure what.

1

1 Answers

-1
votes

I don't know what changed, but now the same query works:

metrics=ga:sessions&dimensions=ga:pagePath,ga:eventLabel

Although I think having uniqueEvents as the metric is probably more useful:

metrics=ga:uniqueEvents&dimensions=ga:pagePath,ga:eventLabel