-
Improving Google Analytics Audience Creation with Regex
Yo, I’m whipping up some audiences on Google Analytics 4 and hit a bit of snag. Turns out there’s a quota when applying conditions to the same audience – lucky I found a way around it with regex. Here’s what I’m aiming for:
I want to include folks who completed a purchase event where the item_name includes any of these terms: Cappuccino, Flat White, Mocha, Latte, Americano, Ovaltine, Bubble Milk, Croissant, Sugar Loaf, Thick Toast, Mini Donuts, Ciabatta, Pizza Bread, Baked Pasta, mousse cake, cheesecake, or tiramisu.
And here’s the regex I’m trying to use to make that happen:
- Purchase event where item_name matches this regex:
(^Flat White$).*|(^Bubble Milk$).*|(^Sugar Loaf$).*|(^Thick Toast$).*|(^Mini Donuts$).*|(^Pizza Bread$).*|(^Baked Pasta$).*|(^mousse cake$).*
OR - Purchase event where item_name matches this regex:
^(Cappuccino|Mocha|Latte|Americano|Ovaltine|Croissant|Ciabatta|mccafe|cheesecake|tiramisu)
Okay, regex masters, how am I doing? Anyone see any issues?
I’m a little concerned because the audience pool is smaller than I thought it would be – could there be something wrong with the above regex?
- Purchase event where item_name matches this regex:
Log in to reply.