Google Tag Manager Naming Strategies to Organize Your Container/
April 18, 2016
Google Tag Manager is a great tool for creating, keeping, and delivering tags to your website. We use Google Tag Manager (GTM) everyday to define all sorts of custom tags for different websites. When you spend quite some time in GTM, you start realizing that having a naming convention in place helps you be more productive and helps your container stay more organized.
You will especially appreciate following a naming convention if you are dealing with a large size container and your Tags are derived from various GTM components. In my last blog, I covered Google Analytics Naming Conventions, and I got some great feedback. In this blog, I’m going to introduce some options for naming conventions for Google Tag Manager.
Account and Container
Your GTM Account is usually the name of your business or website; e.g. LunaMetrics. If you are an agency, you should have separate Accounts for each of your clients, with the Account names being the name of the clients. All users under an account will at least be able to see the other users in the same Account, so you would never want your clients to be able to see other clients.
For the Containers, you can simply use your website’s name or address, e.g. LunaMetrics.com. If you are dealing with different websites and you would like to have separate Containers for each, keep them all under the same company (Account) name.
If you have multiple environments, ideally you would use the same GTM snippet. However, if you are using different GTM snippets, you could include the environment name as part of the container name such as www.example.com – production or qa.example.com – staging.
There are several strategies for naming Tags, so find the one that works best for your organization. As long as you follow a set of simple consistent rules, you will keep your tags organized. Here are a few options for naming Tags:
Include the Product Type
For example, add “GA” for Google Analytics tags, “AW” for AdWords, “DC” for DoubleClick, “HTML” or “CU” for the Custom HTML Tag. You may also include third party tag types like LinkedIn, CrazyEgg, ClickTale, etc.
True, there is a column that tells you what type of Tag it is, and that column is sortable, but this method will automatically sort your Tags by type when GTM loads, and makes it really easy to see what groups of Tags you have.
Include the Track Type
Include the Track Type if you are creating Google Analytics Tags. For example, you can have Pageview, Event, or Social in the tag name. For AdWords Tags, you can have the Tag Type, such as Conversion or Remarketing, in the name.
Include Specific Page(s)
If a tag should fire on a specific page, or a set of pages (like a subdirectory), then include the page/subdirectory in the tag name.
- GA Pageview – Technical Support Form
- GA Pageview – Thank You – Campus Visit Form Submitted
- GA Event – Homepage – CTA Clicks
- GA Event – Blog – Subscribed
- AW Remarketing – Thank You
Include the Description of Trigger
Always include a brief description of the Trigger in the Tag name to provide additional information about the tag functionalities specifying where, when, or on what element the tag fires.
- GA Event – 404 Error
- GA Event – Downloads
- GA Event – Homepage – Carousel Clicks
- GA Event – Search Results – Sort Menu
- GA Event – Form – Info Request Submitted
(Optional) Remember that you can group your Tags under separate Folders to be able to sort them easily and understand where they belong to at a glance.
For example, you can have separate folders for vendor departments (Marketing, UX, etc.), or you can create folders for different sites if the Container contains Tags for multiple domains. Unfortunately, a Tag/Trigger/Variable can only be in one folder at a time. You can use the dropdown menu in each Tag/Trigger/Variable to save it under a folder.
Here are a few more Tag examples, following the above convention, to give you some ideas on how to name your tags:
- GA Event – Outbound Links – Sister Sites
- GA Event – Outbound Links – Social Sites
- GA Event – Outbound Links – Other
- GA Event – EE – Checkout
- GA Event – EE – Product Detail View
- GA Event – EE – Add to Cart
- HTML – YouTube Tracking
- HTML – Scroll Tracking
No matter what casing you use, be consistent. Google Tag Manager uses Title Case for most of its fields, including Variable names. My personal preference is to make all my Triggers and Variables lowercase. I think this helps keeping the Tags page less cluttered and easier to scan. Also, it helps me differentiate between the built-in variables and triggers and the ones I define. Again, it doesn’t matter which method you use, as long as you’re consistent!
For the Triggers, you could include any of the following pieces in the Trigger name:
It makes sense to start with the particular “event” that you’re using to fire the trigger – click, link click, form, etc.
If it makes sense to include the page the event is firing on, then add it to the Trigger name. Also, add in the element you are tracking; by element, we mean what link they clicked on, what form they submitted, etc.
- click – that specific page – that specific element on page
- pageview – thank you page
- pageview – 404 page
- click – search results – search button
Include the action that is taking place on the page.
- form – newsletter signup
- link click – file downloads
- custom – account login
- custom – scrollTracking (here I am using the custom event name as it appears in the custom trigger)
- custom – videoTracking
- custom – ecom addToCart (for the “Ecommerce – Add to Cart” action)
You can always define Blocking Triggers to block some Tags from firing in certain environments; for example, you can block all tags from firing in the Production Environment, or you can block them when you are in Debug Mode. For this specific purpose, we suggest having a uniquely named Trigger such as BLOCKING – Block in Production or BLOCKING – Block in Debug Mode.
As I mentioned before, I tend to keep all the Triggers and Variables in lowercase, but it doesn’t really matter as long as you stay consistent throughout the implementation.
Type of Variable
What It Contains
Next, include what the Variable actually returns or contains. In other words, name your variable whatever you want it to do. For example, if the variable contains query parameters in the URL, name it “url query parameters”. Or if the variable captures a form field value through the dataLayer, you can name it “dlv form field”. Use whatever that makes sense to you, and try to stay consistent.
In this blog, I tried to show you some possible options you have for naming your tags, triggers, and variables. Of course, you are not obligated to follow the above suggestions, just make sure to follow a naming convention of your choice and stay consistent throughout the implementation. Please share with me your creative thoughts on GTM naming conventions. I am very interested in hearing what you think.