The homepage can also have extra GET params (e.g. utm tags and similar marketing variables). How can I make it work? Simple "end with http://example.com or http://example.com/" doesn't work cause the url might be http://example.com/?utm_campaign=text&...
Thanks!
To start collecting data, you need to put the Google tag in the code of your website. The Google tag must be on every page that has data you want to collect.
The first code block is best placed immediately after the web page's opening <head> tag, or as high in the <head> as possible. This helps to ensure that your Tag Manager configuration is available and ready when the rest of the page loads.
Incorrect trigger. The first thing to check why your tag did not fire in GTM is firing triggers. Here's a simple process to follow when this happens: Choose an event in the Preview and Debug console's event stream (left side) and click the tag that behaved unexpectedly.
The best practice is always install the GTM along you domain and execute it whenever you need. To launch a tag only in the home you need to use the following trigger. Add this on you custom HTML tag, take care of the equals.
I know this is an old thread; but I found it after I solved this myself. I created a trigger for Page Path
matches RegEx
and used:
^\/(\?(.*))?$
What that does is matches for ONLY the hostname with no path (www.domain.com/) OR matches if a ?
follows the /
.
Might be another way to do this. Completed trigger:
I've achieved the same using Page Path matches RegEx
^\/$|^\/\?
This means: match a string that begins (^) and ends ($) with / OR (|) that begins with /?
\ precedes special characters to denote that they should be treated as text and are not part of the expression.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With