'Page URL in Google Tag Manager

How can I make this looks better in one line maybe, Instead of using four lines.

Screenshot



Solution 1:[1]

By either using a regex or just contains. I would go with a regex. Just test it well. Something like this: sub\.domain\.com\/en(\/|#){0,2}$ I removed the protocol because it's not essential there. You will get it anyway in your GA call, so easy to manipulate the data as you wish.

Tested here: https://regex101.com/r/ZjqXnu/3

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BNazaruk