You can implement Google Tag Manager for your help center.
About Google Tag Manager
According to Google, "Google Tag Manager is a tag management system that allows you to quickly and easily update tags and code snippets on your website or mobile app, such as those intended for traffic analysis and marketing optimization. You can add and update AdWords, Google Analytics, Firebase Analytics, Floodlight, and 3rd party or custom tags from the Tag Manager user interface instead of editing site code."
Much like Google Analytics it requires you to implement some JavaScript and HTML embed code in your help center. From there it’s able to dynamically embed code snippets into your site. The best part is that you manage it all from a the Google Tag Manager interface, rather than implementing custom code in your help center. Unlike the Google Analytics integration for your help center, implementing Google Tag Manager requires only simple modifications to your theme templates in Zendesk Guide.
Implementing Google Tag Manager
Sign up for Google Tag Manager
First, you need to sign up for a free Google Tag Manager account.
- Sign up for Google Tag Manager for free.
- Set up a new account.
Be sure to select Web as Where to use the container.
- Once your new container is created, copy the two snippets of code to embed in your
help center.
Add the embed code to your help center
Now you'll paste the embed code from Google Tag Manager into two templates in your help center theme.
- In Guide, click the Customize design icon (
) in the sidebar, then click Edit theme.
- Paste the first snippet in the Document Head template.
- Paste the second snippet in the Header template.
- Save your changes.
Create your tag in Google Tag Manager
From here you’ll need to create a tag to test out in your new container.
- Select Add a New Tag in your workspace in Google Tag Manager.
For the example here, we’ll just set up a new Custom HTML tag, but Google Tag Manager provides templates for a bunch of third party tags like AdWords, Google Analytics, Google Optimize and more.
- Create a new Custom HTML tag with a simple script tag and an alert to verify that
your changes are being brought into your help center and set it to trigger for All
pages on page view.
- Once you have your new tag, click Submit on your Workspace.
- Select Publish and Create Version and give your container a new version name
and description, then click Publish.
View changes in your help center
Now you can see the tag you built in your help center.
- Go back to Guide and refresh the preview of your help center.
- See the alert that you built in your Custom HTML tag.
Next steps
Now, you’ve configured a container and an example tag from Google Tag Manager and embedded it into your help center.
Google Tag Manager is an incredibly powerful tool for managing analytics and traffic performance tools. Google has put together a lot of resource on use and best practices with Google Tag Manager here.
6 Comments
Does this track activity within articles? Will this track user IDs?
My goal is to understand what my users are clicking within the guide. For example, If I embed a youtube video does ZD or GA track click through metrics?
Hey Taylor, thanks for the question!
I can understand the need to keep track of what is going on in your help center! The Google Analytics code described in this document and on this one here - https://support.zendesk.com/hc/en-us/articles/205402318-Enabling-Google-Analytics-for-your-Help-Center - will be tracked within Google Analytics.
These process on our help center are meant to help describe the implementation process but gathering information and reading the results is something that will need to be done on the Google side of things.
I hope this offers you a point to start from. For more information about what information is tracked I would recommend working with Google directly.
I was happy to find this article. However, when I tried to find the right place to paste the snippet, my view does not correspond with the article steps.
I am talking about this step:
Add the embed code to your Help Center
Now you'll paste the embed code from Google Tag Manager into two templates in your Help Center theme.
With number 1, I can click on the Customise design icon, but I am unable the find the Edit theme button, let alone end up in the menu that is showed on the image.
Where do I have to paste the 2 snippets?
Please help
This article appears to be out of date.
After clicking on the eyeball and getting a list of themes, I can "View Theme" but not edit.
if I view the theme, I'm given the option to "Edit Code" but that gives a scary - " if you edit the code you won't get any updates to the them from ZenDesk".
there's got to be a simple way to add tag manager.
looking forward to your support.
Iris Vermeulen and Andy, I've updated the instructions to make this a bit clearer.
You need the Professional or Enterprise plan to be able to edit your theme code. Also, I can confirm that this is the correct mechanism to add Google Tag Manager. By adding Google Tag Manager you are customizing the Copenhagen theme, so the warning is just letting you know that your theme is then no longer linked to any updates that are deployed as part of the Copenhagen theme.
I hope that helps.
I found this Google PDF that explains two options. I believe I fall into Option 1. Do I need to install the container, or do I simply add the Google Analytics code snippet to the document_head.hbs?
Thanks for the help!
Please sign in to leave a comment.