Understanding your audience is a major part in determining the success of your website. If you have a general idea about what content your audience looks for on your website and what content on your website is more successful, you’ll have an easier time improving these factors and gain more success.
For this purpose, many tools have been created to help you collect and compile this information and use them accordingly. However, these tools vary in purposes and use and managing them collectively can be quite difficult.
Why should we use Google Tag Manager?
Google Tag Manager is an extremely resourceful web tool that lets you add useful snippets to collect and send data to other third-party tools. These third-party tools include AdWords conversion tracking, DoubleClick floodlight as well as Google Analytics.
Google Tag Manager allows you to easily allow these snippets to work on your website, manage its data accordingly and delete them if necessary. Google Tag Manager or GTM for short, works by providing an interface to manage these snippets easily instead of requiring you to modify their code directly.
Thus, here’s where the need for Google Tag Manager comes, instead of hard-coding the snippet codes and requiring tough changes in order to modify data tracking, you can simply use GTM to separately create tags and add them, all without barely any understanding of HTML.
Using analytic and tracking tools are made much easier, especially for beginners by the use of Google Tag Manager. So, let’s talk about how to integrate this into WordPress.
Setting up Google Tag Manager
First of all, let’s sign up for Google Tag Manager and register an account for your website.
For this, open the website and click on Sign up to start a new account. <link>
Login with your Gmail id and the website will refer you to the new account page.
Here places the name of your account. Then select the country your organization or business is based on.
Click on the Share Data anonymously option to allow you to send the data to Google while still hiding your website’s private details. This allows Google to save data from multiple websites, create benchmarks for comparisons and improve the service as a whole.
Then click on Continue.
Next, you will insert your container name. This is generally your website’s name. Select your container as Web and click on create. Then accept the agreement by clicking on Yes on the top right to create your GTM container.
A set of codes will be provided to you, however, keep this copied for now as it will not be much of a use right now.
Creating tags for Google Tag Manager
Now we need to set tags for various tools for your website. First, open your Google Tag Manager dashboard.
Click on Add New Tag to start.
Then, in the new window, click on Choose a tag type. Here you can select what type of snippet to create, for demonstration let’s use Universal Analytics for Google Analytics.
In the tag configuration menu, choose the Track type. For example, every page view triggers the tag for Google analytics. This trigger can be changed using Track type.
Next, click on the Variable type/Google Analytics settings menu and choose New variable type.
Set your tracking ID in the Tracking ID field. This will be provided to you if you sign in for Google Analytics individually using your website. To learn about this tracking code and Google Analytics as a whole, refer to here.
Then click on save to create the new variable settings by naming it down. Choose this new variable that you just named.
Now for Triggering, you can choose what pages trigger the Google analytics tag. For now, we will select All Pages. Furthermore, you can insert the exceptions and choose what pages do not trigger the tags. Once done, name your Tag and Click on Save to create your tag.
Now we need to copy our containers onto our WordPress website to start tracking. You can use the code we saved at the start but if you need to find it again, you can do it by using the Admin settings.
Simply click on Admin and then Click on Install Tag Manager. Then copy the two separate codes provided to you.
We need to insert these codes into all our pages in order to start tracking.
Enabling Google Tag Manager
Now we insert these codes into our WordPress website. For this, simply open your WordPress theme editor and manage the Header.php template.
First, go to your WordPress admin dashboard and hover over Appearance. Then click on editor to open your theme templates. On the far-right list of Theme files, scroll down and click on Theme Header.
This is your header.php file and here we will insert the Google Tag Manger’s container code. Take both the codes we saved earlier and copy them right under the “<Body>” section.
This should enable Google Tag Manager on all your pages.
To check whether GTM functions well, open Google Tag Manager on a tab and enable Preview mode on it. Simply click on the Preview on your Google Tag Manager workspace window.
Once this is enabled, open your website in a separate tab and Google Tag Manager should show you a debug window.
Thus, you can easily enable various Tags and analytical tools on your website. You can add more tags for DoubleClick Floodlight, AdWords, Google Optimize in a similar way by simply adding newer tags in the Workspace window.
Using these steps, you can enable Google Tag Manager and tons of other useful tools on your website to study your demographic tools. These tools allow you to easily improve your website by studying what kind of content to focus and what products to sell.
Furthermore, do remember that enabling tag still requires you to have these tools enabled and requires you to use their respective IDs and codes.
For added benefits, we’ve listed these useful tools that can help you immensely to improve various aspects of your website and study the important elements you should focus on:
- Adding SSL and HTTPS to your WordPress website
- How to add Google Analytics to WordPress
- Embedding Google Map in WordPress