One of Google Tag Manager’s oldest and most reliable features is that it freezes the state of Data Layer variables to the moment when the trigger event occurred. Thus, any tags firing on this trigger (and any variables resolved on this trigger event) will always have access to the same value of each Data Layer variable. However, there are situations where this is not a good thing. One is tag sequencing, and the other is a scenario where you want to run some custom code that should access the latest value of the Data Layer variable at a moment in time after the tag has already fired.
Updated 7 March 2019 - Added some extra caveats to this solution. Also, be sure to read my article on ITP 2.1, which has far more detail on what Intelligent Tracking Prevention is and how to work with it. Looks like Safari is tightening the noose around browser cookies with the introduction of ITP 2.1 (Intelligent Tracking Prevention). Among other things, ITP 2.1 caps the expiration of client-side cookies to 7 days.
A recurring question in the Google Tag Manager communities (e.g. product forums) is how to use an Enhanced Ecommerce dataLayer object with the Facebook pixel code? It’s a common question since running a Facebook conversion pixel on a site that also collects data from the store into Google Analytics’ Enhanced Ecommerce reports is probably a very typical scenario. Side note: Since Google+ is about to go the way of the dodo, I’ve created an archive of the entire community which you can browse and make text searches against.
Thanks to the intrepid detective work of Jørn Reidel and Ahmed Marof, it looks like one of the big hurdles for doing a full migration from using the legacy Google Analytics and Google Tag Manager SDKs to the latest Tag Manager + Firebase SDK is now a non-issue. The issue is, of course, Product-scoped Custom Dimensions or more specifically the lack of support thereof. Until now, I’d been holding against recommending the migration to anyone with Enhanced Ecommerce tracking set up simply because the documentation didn’t mention the possibility of sending these custom definitions to Google Analytics.
If you are enjoying the Element Visibility trigger as much as I am, you’ll be glad to know of a very simple tip that might make your life easier when using Google Tag Manager. The tip is this: If you’ve activated the built-in Click variables, they will be automatically populated with details about the element that caused the Element Visibility trigger to activate! Tip 92: Use Built-in variables to analyze the visible element Yes, it’s confusing they’re still named Click variables, especially since they’re duplicated in the Form variables, and even more so since they can be used with the Element Visibility trigger to identify which element became visibility.
- OLDER POSTS
- page 1 of 14