Learn business growth with Google Analytics 4 › Forums › Google Analytics 4 › Improving Google Analytics Audience Creation with Regex › Reply To: Improving Google Analytics Audience Creation with Regex
-
The first regex you’ve written includes a “$” symbol after each term which means it will only match entries that end with the specified term. Consequently, this may exclude matches where there are additional characters or words after the term in your event names. Also, there appears to be a discrepancy between the list of terms you’ve mentioned initially and in your regex. For instance, you mention “Cappuccino” in your initial list but feature it only in your second regex. Therefore, it’s recommended to use a single regular expression that includes all your terms and eliminates the “$” symbol. This could look like this:
^(Cappuccino|Flat White|Mocha|Latte|Americano|Ovaltine|Bubble Milk|Croissant|Sugar Loaf|Thick Toast|Mini Donuts|Ciabatta|Pizza Bread|Baked Pasta|mousse cake|cheesecake|tiramisu)
. Be careful to match the case because regex can be case-sensitive. If there are still issues, scrutinize your data to ensure these item_names exist as you expect. If the audience pool is still smaller than anticipated, it’s possible some of your events are not being caught or there might be other discrepancies in your data.