GTM Trigger: Collect all events except for standard "gtm."

Created by Todd Belcher, Modified on Thu, 17 Oct at 2:38 PM by Todd Belcher

Google Tag Manager: Create Trigger to Exclude Automated "gtm." Events (gtm.load, gtm.dom, etc)


When setting up a pass-through to "track all events" in GTM, you may end up with unwanted events that come out of the box from the gtm.js / Google Tag Manager. To trigger on all events except those, you can use a "negative lookahead" regular expression as shown below.


^(?!gtm).*

Technically speaking, this matches from the start of the event name. Instead of a typical match, however, the match is of a negative lookahead (?!gtm) meaning the string "gtm" can not come next after the start of the event name (^).


What can come after the start? Anything else. (.*)



Sending only "gtm." events to a monitoring profile in GA4

Fortunately, most Google Tag Manager users have no problem creating a trigger to only fire on custom events that start with gtm. 



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article