Google Tag Manager WordPress install

One of the most searched queries on Google is how to install Google Tag Manager. Since 2022, Google even more specifically recommends using this. Especially in combination with Google Analytics 4, where you actually have to set a lot more yourself because everyone has their own goals and KPI;s for her online website on web shop. But for many people, this is challenging. So how do you put Google Tag Manager on the website?

In this article, we will discuss installing the Google Tag Manager on a WordPress website. WordPress is a frequently chosen CMS system for various entrepreneurs and businesses because it is a free CMS system and one can manage it completely by oneself. So that also means that you can get started using Google Tag Manager on your site quite easily yourself. Several how-to’s and blogs can now be found on the Internet. But we hereby give our best experiences.

Do you use a plugin or do you prefer to place the code manually?

This is a common question and most people with little understanding of HTML or the front-end of a website will look for a plugin for WordPress. 1 of the most commonly used is GTM4WP or Google Sitekit. Both are great plugins to get started with and provide many additional features for novice users of Google Tag Manager. Of course, we prefer manual, because it prevents plugins from adding huge extra files or workload and we like to keep the website source code clean. This is because we want to avoid as many unnecessary invocations to external sources as possible, as this can slow down the website or web shop tremendously.

So where do you put the Google Tag Manager?

If you create a new account at tagmanager.google.com, Google already provides instructions on how to do this. You can also email this instruction to your web builder, but you can also do this perfectly well yourself in WordPress. According to Google, the Google Tag Manager code should be as high as possible in the header of your website and on all pages. In WordPress, you can usually do this in the header .php file that you can find under Display > Theme > Theme Editor.

Usually this file looks like this: A bunch of code and there, if all goes well, is the following code, see image. Right below this code, preferably place the first part of the code you see in Google Tag Manager window:

head file wordpress google tag manager

This is the screen you see after you create Google Tag Manager Container.

Implementing Google Tag Manager

Next, place the 2nd part of the Google Tag Manager code under the body tag. This script is particularly intended for devices that do not support or block Javascript, so you still have data. In case you are thinking, why is the url in your image different from the example, that’s because we are using Google Tag Manager Server Side. In short, this means that we use a different url to run data, namely through our own Google Cloud Server. More on this in another article.

OK, I followed your steps, saved the file. Is it working now?

Basically this works out of the box, there are several ways to control this, including through various chrome extensions, but the best thing to do after you have posted and saved this is to create a 1st tag, for example that of GA4. If you don’t know how to do this, you can also watch our video on this. If you then hit preview, Google Tag Manager will ask if you want to open the website with a debugger and if all goes well, you will see the tags loaded from the Tag Manager on your website. See this example below:

preview mode google tag manager

The tags are loaded on the website:

google tag manager preview active

And voila,

the installation succeeded and the tags are loaded. So from now on, you can add code and tags yourself without the intervention of your web builder or designer. Do be very critical of how much code you load extra through GTM and whether this code is really necessary. GTM also adds delay as long as you don’t switch to Google’s Server Side tagging. If necessary, have your Google Tag Manager setup reviewed and rated by us. You can easily use QUICK Support for this through our website.

Fill out the form below for more information or check out our Google Tag Manager Implementation

blank

Author: Paul Gudde

Function: Founder

Active since: 2007

Number of items: 25

LinkedIn profile

Specializations: Google Analytics, Google Tag Manager, Google Ads, Google bigquery, Server Side Tagging

Let’s Make Things Happen

“Take the step to data enrichment today. Make the most of Google Analytics by leveraging our specialist knowledge.”

“Thanks to Paul’s implementation, we were finally able to get insight from Analytics to come up with actions. Paul clearly has experience in b2b marketing and puts us as a customer first in doing so”

Luuk van Dorp

Sales marketer WEX

Free Support & Advice Request

Attributions needs the contact information you provide to contact you about our products and services. You can unsubscribe from these messages at any time.