Leverage Enhanced Ecommerce Data Layer for Marketing Pixels

This post contains scripts that you can use as Custom JS Variables in Google Tag Manager. These scripts all target the quite specific (yet common) use case where a site already running Google Analytics Enhanced Ecommerce now needs to run additional marketing or analytics tags. Related post: Collect Enhanced Ecommerce Values into GTM Variables CONTENTS ... Read more

Set up Custom Dimensions using GA, GTM, and the Data Layer

This article was written for Universal Analytics, which will stop processing data in July 2023 as Google switches to GA4. As GA4 requires almost completely new configuration, check out Google's migration guide here, or, for a complete done-for-you solution, I recommend Mediauthentic. . Adding a custom dimension to Google Analytics involves several interconnected parts: the ... Read more

Event Tracking with Data Attributes in GTM

This article was written for Universal Analytics, which will stop processing data in July 2023 as Google switches to GA4. While the underlying HTML/JS techniques can be carried over, GA4 requires almost completely new configuration. Check out Google's migration guide here, or, for a complete done-for-you solution, I recommend Mediauthentic. . One common method of ... Read more

Useful Custom JavaScript Variables for Google Tag Manager

This post shows some useful Custom JavaScript Variables for Google Tag Manager. #2 and #3 require modification for your own site, while the others can be plugged in directly. Add Custom JavaScript Variables by navigating to Variables > New > Custom JavaScript. CONTENTS #1 Value of the Closest Parent ID#2 Text of the Closest Specific ... Read more

GTM dataLayer.push Examples (Standard, Ecommerce, Advanced)

This post shows four examples of using the dataLayer.push method to pass in extra metadata to Google Tag Manager (GTM) via Variables. #1 Standard GTM Data Layer Push Syntax#2 GTM Data Layer Push with Array#3 GTM Data Layer Push with Nested Key-Value Pairs#4 GTM Data Layer Push with Nested Arrays #1 STANDARD GTM DATA LAYER PUSH ... Read more

Collect Enhanced Ecommerce Values into GTM Variables

Setting up Enhanced Ecommerce tracking via Google Tag Manager & Google Analytics generally involves creating a data layer that contains all the relevant values, as described here: https://developers.google.com/tag-manager/enhanced-ecommerce#purchases These same values are often required to set up other marketing and analytics tags. For example, the Facebook conversion pixel looks like this: <script> fbq('track', 'Purchase', {currency: "USD", ... Read more

Content Marketing Analytics: Conversion Rate by Page

While Google Analytics provides many reports and metrics designed to evaluate the effectiveness of content marketing, there is no report showing the conversion rates of specific posts or pages on your site. For example, if you're tracking registrations on your site, you may want to know which specific posts are associated with signups, even if ... Read more