Analytics
2.5K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Building a filter with eventLabel using the Google Analytics API

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

I'm using the Google Analytics API to create automated reports that pull events based on total events that happened on a specified page path.

The structure is currently set up like:

Metrics: ga: totalEvents
Dimensions: ga: eventLabel, ga: source, ga: channelGrouping
Sort: -ga: eventLabel
Filters: ga: pagePath=~locol-watts-roy-choi-daniel-patterson


I've had success with a filter that only pulls based on a RegEx pagePath (below):
ga: pagePath=~locol-watts-roy-choi-daniel-patterson --OR-- [ =concatenate("ga: pagePath=~",'Play: Mid Function'!$C$2) ]

But have had zero success when trying to add in a RegEx eventLabel (below):
ga: pagePath=~locol-watts-roy-choi-daniel-patterson;ga: eventLabel=~Cheap, Healthy, Fast Food at LocoL in South LA | 9452 --OR-- [ =concatenate("ga: pagePath=~",'Play: Mid Function'!$C$2,";ga: eventLabel=~",Input!C7) ]

When I run the report with the eventLabel in the filter I receive this error (below): 

1 report failed due to errors

  • Off Story Video Views: Invalid value 'ga: pagePath=~locol-watts-roy-choi-daniel-patterson;ga: eventLabel=~Cheap, Healthy, Fast Food at LocoL in South LA | 9452' for filters parameter.

*Please note: I've put a space after every occurence of "ga:" to prevent it from auto creating an emoji like this Smiley Tongue