Google Tag Manager: How to create a cookie

Creating a cookie in Google Tag Manager is very easy.

  1. Create a custom HTML tag
  2. Insert the cookie script below and update the following values to suit your needs:
    1. Name (name of the cookie, which can be anything you want)
    2. Value (the value the cookie should hold)
    3. Days (how many days until the cookie expires)
  3. Create the trigger i.e.  when should the cookie be created
  4. Publish and you’re done. Super Easy!

Code to create a cookie

Continue reading “Google Tag Manager: How to create a cookie”

Should you set Google Analytics up on the staging site?

A common scenario is for a new website to be built on a test staging server that requires tracking to be implemented. Ideally, you’d want to set all the tracking up on the test site but you don’t want this data going into the main Google Analytics Property since it’s not real data but you do want to be sure all of the tracking is in place and works correctly.

The best way I’ve found to do this is to:

Continue reading “Should you set Google Analytics up on the staging site?”

How to migrate to Google Tag Manager without any loss of data

A common scenario is migrating clients from hardcoded Google Analytics tracking to Google Tag Manager. In this post, I will explain how to switch over without any loss of data at all.

The way we’ll to do this is to create a custom javascript variable that checks to see if Google Analytics tracking is hardcoded in the source code.

Continue reading “How to migrate to Google Tag Manager without any loss of data”

Google Tag Manager listeners not working

If you have definitely turned on the form submit and click listeners in Google Tag Manager but the listeners are not working when they should be then it’s possible that poor JQuery implementation is obstructing Google Tag Manager.

To fix that you can add a GTM Custom HTML tag with the script below to run on the pages where the listeners are not working:

Continue reading “Google Tag Manager listeners not working”

How to change bounce rate with Google Tag Manager

Personally, I implement this on content sites since a visitors is often looking for one article & even if the visitor is completely satisfied with the article, Google Analytics will record the visitor as a bounce if they do not navigate to another page.

I do not implement this on any ecommerce sites since the goal of these sites is never to visit just one page and a single page view, in my opinion, should be classed as a bounce.

Continue reading “How to change bounce rate with Google Tag Manager”