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 Useful Custom JavaScript Variables for Google Tag Manager

DOM Scraping Together a Datalayer for Google Analytics Ecommerce Tracking

Google Analytics’ e-commerce tracking is generally the most developer-intensive part of a Google Analytics implementation, because it requires a developer-built data layer on the transaction confirmation page. The data layer collects all the relevant data — the transaction ID, the checkout total, the product names, the prices, and so on — and lays them out … Read more DOM Scraping Together a Datalayer for Google Analytics Ecommerce Tracking

Track Popular Blog Tags and Categories in Google Analytics

If you have a blog or work with content, you will likely want to know which type of posts are viewed most frequently by your readers. Google Analytics provides a lot of options for tracking content: it will show you what specific posts were the most viewed in the Top Pages report, allows you to … Read more Track Popular Blog Tags and Categories in Google Analytics

DOM Scraping into Data Layer & Custom JS Variables

While Google Tag Manager is best used in conjunction with a data layer, there are many cases where it will make sense to more rapidly deploy tags by scraping the DOM instead. Generally this is because DOM scraping means using the elements that already exist on the page — the page titles, classes, IDs, URLs, … Read more DOM Scraping into Data Layer & Custom JS Variables

Track Number of Search Results in Google Analytics with GTM

Tracking the number of onsite search results is useful for finding common searches for which few, or zero, results were returned, so that you can address gaps in your product or content offerings. This metric can also be used to analyze the correlation between search result counts and conversion rates. While the built-in onsite search … Read more Track Number of Search Results in Google Analytics with GTM

Google Analytics Event Tracking in Google Tag Manager

There are many types of site interactions you may be interested in tracking: scroll distance down a page, clicks on a hero image, email address submissions, and so on. All of these can be tracked using Google Analytics’ event tracking tags, which in turn can be set through Google Tag Manager (GTM). ❓ GTM is … Read more Google Analytics Event Tracking in Google Tag Manager