Digital Intelligence
4 min

MeasureCamp Recap: Making Your Life Easier With Custom Templates In Google Tag Manager

Jared Smith Analytics Engineer

I was fortunate to be able to represent Wpromote at the first-ever MeasureCamp in the State of Texas (and only the third location in the United States!), MeasureCamp Austin. MeasureCamp is the world’s largest Digital Analytics ‘unconference’, meaning it is run by members of the Digital Analytics Community for the Digital Analytics Community. You can find out more about MeasureCamp by visiting the official website.

One of the most unique things about MeasureCamp is that there is no pre-arranged agenda and anyone in attendance can, and is encouraged to, lead a session on a topic of their choosing. Although I had never given any presentation of this type before, I was super excited about the opportunity and decided to prepare a session on a topic that I have been passionate about over the past few months — Custom Templates in Google Tag Manager.

What Are Custom Templates In Google Tag Manager?

Introduced in the Summer of 2019, Custom Templates are a means of creating safe, reusable, and portable Custom HTML/JavaScript elements in Google Tag Manager (GTM). Google has also opened Custom Templates up to the GTM community in the form of the Community Template Gallery, where Custom Templates can be shared. The GTM Community Template Gallery can be found here.

google community template gallery

Why Do They Matter?

Before Custom Templates, it was very common for me to have to write the same Custom JavaScript functions over and over to be able to do routine things. Things like returning the total price of a purchase made on a Shopify ecommerce website are both highly useful (for things like dynamic conversion values in Google Ads) and highly common. Below is a screenshot of the Shopify data object where all transaction data is recorded when a purchase is completed.

custom shopify javascript

Since the Shopify data object is not natively available to GTM, or your tags, I would end up writing something like the following to return the total price of a purchase for use in Google Ads Conversion tags.

google ad conversion javascript

There Had To Be A Better Way!

Using Custom Templates in GTM, I created a variable template that will return almost any of the data points available in the Shopify data object using a simple dropdown menu.

NO CODING NECESSARY.

custom template google tag manager

Pretty Cool, Right?!

I think we can all agree that this kind of write once, use anywhere solution for GTM is pretty cool, but the real power comes when you combine Custom Templates. For example, you could combine the above custom template with another, and use it to build ecommerce dataLayers on any Shopify site, with no coding necessary. The example below uses the dataLayer Builder + Standard Ecommerce Custom Template, and populates with values pulled from the Shopify Custom Template above.

standard google ecommerce custom template

So, Now What?

I hope this has given you some idea of the utility of Custom Templates in GTM. If you use GTM at all I would highly encourage you to check out the Community Template Gallery to see what’s already out there.

If you don’t find what you’re looking for I would encourage you to build it and submit it to the Gallery, because if it’s useful to you it will likely be useful for others as well.

If you have an idea for a Custom Template but don’t know where to start, please reach out as we would love to collaborate.

Parting Thoughts

MeasureCamp Austin was an incredible experience for me. Not only was I able to lead a session about a topic that I feel strongly about, but I also got the chance to participate in many meaningful and timely discussions related to the current state of Digital Analytics. I cannot speak highly enough of my experience at MeasureCamp and would encourage all who are able to attend one to do so.

For anyone interested in learning more from my presentation at MeasureCamp, the slides can be found here.

Analytics Digital Intelligence Google Analytics

Responses

Write a response…

Related Posts
Prev
Next

Think Like A Challenger

Subscribe to keep up to date on the latest innovations in digital marketing and strategies our Challenger Brands leverage for success.

All