When we updated our Drupal sites to Drupal 11 and also upgraded the DataLayer module to its latest version (2.1.0), we encountered an issue where all DataLayer variables passed to Google Analytics via Google Tag Manager were showing as undefined or not set. Further debugging revealed that this issue arises because the initialization of the DataLayer variables has been moved to the footer of the page and now uses a lazy build approach. Consequently, tags that trigger on the Pageview event in GTM might not have access to these variables, leading to incomplete or missing data in your analytics.
Google Tag Manager
Want to see the result of an experiment we did on one of our high-traffic Drupal websites? Read on. This article is also a 'how-to' with an example of setup a JavaScript-based variable to track the content age group in GTM.
Integrate HubSpot forms with GA4 using our step-by-step guide. Optimize website conversion rates and improve marketing strategy with accurate tracking. Get started now!
This short howto article describes how to use page scroll in Google tag manager to find the scroll depth with variant trigger types.