Google Tag Manager Tips

Google Tag Manager (GTM) is a great tool for managing tags. Tags like Facebook pixel, Google analytics, TikTok tracking, and many more scripts can be managed and deployed in one place.

Here I will be adding tips and tricks related to GTM.

Trigger Configuration

Matches RegEx

Matches RegEx will match strings based on the input against the type of rule placed in the first dropdown.

Here it matches the Page Path with /pages. The case is strict so it only matches /pages not /Pages. if you wish to use any case, you can use Matches RegEx (Ignore Case).

Matches RegEx (Ignore Case)

This rule is similar to Matches RegEx but it do not care about the case so it can match both /pages and /Pages.

In both Matches RegEx or Matches RegEx (Ignore Case) we can use RegEx (you can test RegEx here). In the above example, it also matches /pages and /pages101. If you want to match just /pages then you need to put a $ sign at the end of the rule like /pages$ this would not match /pages101.