Yuma 4×4

Media and Communications

Google Tag Manager WordPress: How to Install Google Tag Manager on a WordPress Site

Google Tag Manager WordPress: How to Install Google Tag Manager on a WordPress Site


What’s up, everyone? Today, you’re gonna learn exactly how to add
Google Tag Manager to a WordPress website. Whole bunch of reasons why you’d want to do
something like this. Obviously as an internet marketer, consolidating
all of your code into one specific place is a huge advantage these days. If you’re working at a larger company, pushing
engineering changes on a production can be costly, dangerous, annoying to the engineers,
so getting Google Tag Manager installed and having all of your marketing pixels there
is a huge advantage. Stay for the whole video. We’re gonna go through the exact step-by-step
process of adding Google Tag Manager to a WordPress website. I’m Tommy Griffith with ClickMinded.com. Let’s get going. Okay. Adding Google Tag Manager to a WordPress website. We’re gonna jump into the ClickMinded SOP
Library for this one. SOP stands for “standard operating procedure.” It’s just a fancy way to say a really comprehensive
checklist. We have a huge number of digital marketing
SOPs on our website at ClickMinded.com. Adding GTM to a WordPress website, this will
only take about five to 10 minutes to do. Let’s do a quick, high-level overview of everything
we’re gonna do right now. What’s the goal here? The goal is to add Google Tag Manager to a
WordPress website. The ideal outcome is that Google Tag Manager
is properly installed and there’s no technical issues. The prerequisites here is that this is only
applicable to WordPress.org installations, so anything on WordPress.com is not going
to work, but if you’ve installed WordPress onto your own domain, you should be fine. Why is this important? Google Tag Manager is the single place that
you should be putting all of your tracking pixels, as an internet marketer, because they’re
a very, very advantageous thing to do. Where is this done? This will be done in both your WordPress back-in
and in Google Tag Manager. When is this done? Only once. This is a huge advantage of this. You only have to install Google Tag Manager
one time, and then you’re set going forward. Then who does this? This will be anyone managing your website,
anyone managing analytics, anyone running maybe paid campaigns, or maybe it’s you. Okay. Let’s talk about environment setup next, to
get this going. First and foremost, you need the Google Tag
Assistant Chrome Extension. We have a link to that down below if you want
to grab it. This is a very helpful tool, not just for
Google Tag Manager installations, but any kind of tracking, Google-based tracking that
you want to validate. This is a very helpful tool, so we’re going
to install that. You also need to sign up for Google Tag Manager
if you have not already, so make sure to grab that. If this is your first time creating a Google
Tag Manager account, you’ll be prompted to set one up. For now, you can just use your company website
and the company name for both the account and the container, right? Okay. Go ahead and enter your account name, or demo
site, or demo testing ground. ClickMinded is A Site About Emojis. It’s literally called ASiteAboutEmojis.com. That’s going to be our account name. “A Site About Emojis” will be our account
name in the US. We’ll hit continue, and our container name
will be the website, “ASiteAboutEmojis.com.” We’re going to use the container on the web,
and click “create.” “English.” We’re gonna accept the data processing terms. You can read through this if you want, and
sign your life away to Google. There we go. Now, Google Tag Manager has been set up, and
the first thing they do is they give us the code, right? Copy the code and paste it into every page
of your website. A couple things going on here. First they ask you to take this code and paste
it as high in the head of the page as possible. We’ll talk about what that means in a little
bit, and then second, we take another snippet of code, and we paste that immediately after
the opening body tag, right? If you’re hand-coding or hand-designing your
site, and you want to paste the code in here, you can, but we actually don’t recommend this. Especially if you’re doing a WordPress installation,
there’s a way easier way to do this. I just kind of wanted to show you the screen
that shows up when you first set up the Google Tag Manager account, so you can just click
“okay” for now and not actually copy any of the code. There’s a way easier way to do this. I’m going to hit “okay.” The first thing you’ll notice when you get
in here is your Google Tag Manager ID up top. You’re going to want to make a note of that. We’ll need that later, so go ahead and right
click it and just copy that, so that you have that on your paste. That is there. The way to think about Google Tag Manager
Workspace is it’s this little container that we’re gonna insert into our website one time,
and a request is gonna be made. Every time that webpage is loaded, a request
is gonna be made to this Google Tag Manager container space, and any of the pixels that
are in it are gonna fire. What that means is that allows us to add and
remove tags from here, instead of having to push new code to our website. If you don’t understand the details, that’s
fine. All you need to do next is go up to the top
right-hand corner, and click “submit.” What we’re gonna do here is we’re gonna push
the Google Tag Manager container live. There’s nothing in it yet, but we’re just
gonna push it live to get this going. In the future, you might be writing version
names and version descriptions, and you might get really heavy with it. You don’t need to now, so just go ahead and
come up top and click “publish.” Again, you can skip the description, and just
click “continue,” and there you go. We are now live with our container. Cool. We’ve set up a Google Tag Manager account,
we published our first container. Now we’re going to go back into WordPress
and set it all up. Head over to your WordPress dashboard, go
over to plugins, and click “Add New.” We’re gonna add a new Google Tag Manager plugin
to WordPress. You can come up here to the top right-hand
side, under “keyword,” and just search for “Google Tag Manager.” Now, there’s a lot of different options here. There’s plenty that work. I think the easiest one and the one we’re
going to show you today is usually the first one that shows up. It’s called “DuracellTomi.” “DuracellTomi’s Google Tag Manager for WordPress.” It looks like this. The author might change the icon from time
to time, but look for DuracellTomi’s Google Tag Manager for WordPress, and go ahead and
click “install now.” That’ll very quickly install, and then you
can go ahead and click “Activate.” Once that has activated, you can go over to
your settings down on the left-hand side, and just mouse over to Google Tag Manager,
and you can come in here and paste your Google Tag Manager ID into the field here. Again, in Google Tag Manager, you’ll see it
up here, and you’ll want to go ahead and click “copy,” paste that in, and then hit “save.” Just a quick review. We’ve logged into WordPress, right? We’ve added the new plugin, right? DuracellTomi’s Google Tag Manager for WordPress
plugin. We activated it. We went over to “settings,” and then Google
Tag Manager, and we pasted our Google Tag Manager ID into that field, and then we hit
“save.” The default in this plugin is custom, and
that’s what we needed. That’s fine. You can leave it as custom. What this means is, we actually need to tweak
our WordPress template just a little bit in order to get this to go, right? If we go ahead and copy this snippet, this
is what they’re asking us to do. If you select “custom,” you need to edit your
template and add the following line just after the opening body tag. The plugin is passing over to the template
the actual Google Tag Manager ID. We just need to do one other quick thing in
the body of the document to get this to go. This is only a one-time thing. This is the beauty of it, is once we do this
work, then we can kind of add pixels and remove pixels ad nauseam, forever and ever, without
having to do this again. This is what’s really nice about it. Go ahead and copy this once you’ve hit “save.” We’ve copied this little snippet here. I’m gonna go back to the SOP and check this
out. We’ve copied it here. Okay, that’s great. In the WordPress sidebar, go to “Appearance,”
then “Editor.” Make sure you’re editing the theme that you
currently have installed in your site, and add it there. What’s going on here is, everyone’s theme
is gonna look a little bit different. I’ll still show you the way to do it that
should apply to most WordPress websites, but in general, every theme sort of has different
files, and might look a little bit different, so don’t worry about this too much. We’re gonna go over to “Appearance,” and then
“Editor.” “Appearance,” on the left-hand side, and then
“Editor.” Okay. We’re now in the theme editor within WordPress,
checking in with the SOP again, so select the theme header template from the list on
the right, and then basically paste the code in after the body tag. We’re gonna look for the theme header file
on the right. I can see it right here. If I wasn’t able to find it that quickly,
I like to just do Command-F and look for it, so there it is. We’re gonna click that. That’s showing us the actual theme header
file here in WordPress. We’re gonna find the body tag. It’s usually near the top. It was there at line 25. That was very easy. Again, if I couldn’t find it, I can just Command-F
on a Mac and type “body,” and that shows it right there. All we have to do is find that opening body
tag, which we did. We’re gonna add a space, so just hit enter,
and we’re gonna paste in that little snippet that the plugin gave us, right? That little PHP snippet the plugin gave us,
and we’re just gonna come down and update the file. “File successfully edited.” Sweet. We’ve set up a Google Tag Manager account. We’ve installed a WordPress plugin that allows
us to easily add the Google Tag Manager code to the site. We’ve just added it to the site. Now we just need to do some quick QA, and
make sure that it’s all working, right? We’re done up to the installation part. Now we just want to verify that everything
is working. First, I’m gonna open up the site, and then
we’re going to use the Chrome plugin that we installed a little bit earlier, the Google
Tag Assistant, which will tell us whether or not we did it correctly. Let’s open up the site. Here’s our beautiful website, ASiteAboutEmojis.com,
and remember, we installed the Google Tag Assistant Chrome Plugin, so all we need to
do is click here, right? I’m gonna just leave all the defaults there. That’s no problem at all. Click “done.” All we need to do is click “enable,” and then
reload the page. I’ve reloaded the page. I’ll open this up, and there it is. Google Tag Manager is working. We’ve got a little smiley guy here, and we
are now installed. That is it. That’s how to add Google Tag Manager to your
WordPress website. I hope that was useful. If it was helpful, and if you learned something
today, go ahead and click “subscribe” down below for even more digital marketing tactics
and tips from us. If you’re watching on YouTube, I’d love a
comment. What did you think? Is this how you’re gonna do it? Do you like to install Google Tag Manager
a different way? I would love to hear what you think. I read every single one. Finally, if you want this entire walkthrough
as a free downloadable guide, along with links to all the resources we mentioned today, go
ahead and click that link down below to ClickMinded.com right now, to get your free downloadable guide. Thanks a lot.

76 thoughts on “Google Tag Manager WordPress: How to Install Google Tag Manager on a WordPress Site

  1. I'm using a child theme so I don't have all those options in the appearance(editing) section. Do I need to switch to the main theme for the editing portion of the video? Do I need to add this plugin to the main version of the theme?

  2. I followed the directions but site would not let me add to body …"Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP."

  3. hi. thanks for the tutorial. are you sure adding the body tag is a "one time" requirement? As whenever I update the wordpress theme, it goes missing again.

  4. Excellent work! Although this plugin isn't tested on 5.0.2. WordPress version, it works perfectly with method you've described in video. Thanks man, keep up with good work.

  5. I have very minimal coding experience and this was easy to follow. I successfully added GTM and am able to add my social media tags to my very new website. Thank you. Also, I am a 47-year-old mom so if I can do it, anyone can!

  6. I followed all steps, but after pasting the tag on my wordpress, I pressed "update" but all I received was, " Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP." I wonder why.

  7. Hi, so great full. But it got messed up in the end. Did set by set , but cant find my installed google tag plug on chrome. Who to enable it in the end?

  8. How does this work if you're wanting to also take advantage of Google Analytics? For example, there's the MonsterInsights Google Anayltics Dashboard plugin which (i believe) has the Google Tag Manager setup as well. Does the Google Tag Manager plugin you referred to handle everything in the same way (essentially) as the MonsterInsights plugin? Which one would you recommend over the other?

  9. Great. Thanks. Had to install using the c-panel. couldn't access the html from wordpress. Took quite a while to find due to the arrangement of the TINY HESTIA TEMPLATE.

  10. I received this message: "Unable to communicate back with site to check for fatal errors, so the PHP change was reverted. You will need to upload your PHP file change by some other means, such as by using SFTP.
    " I got lost.

  11. Dude. Finally a video on this that helped me out! All of the other so called gurus with videos on this missed a very important explanation on how to set the plugin up. Just the small tag after the body en GTM code was enough.

  12. Hi. This was very helpful for one of the themes we use. The other one, Divi was more trickey. Their theme editor is a lot more messy. Is there a plugin you recommend where you just drop in the tag code and don't have to change anything else? Thanks

  13. I successfully added the tag manager to our website hosted on showthemes. I did the test and it was showing up on the tag manager and now 24 hours later, it isn't showing up. Any reason you can think of why this would be an issue?

  14. I was doing fine until I tried to add the snippet below the header and got this message: Something went wrong. Your change may not have been saved. Please try again. There is also a chance that you may need to manually fix and upload the file over FTP. HELP. I am not a techy person and have no idea what to do now and reall don't want to screw up my website. Thanks.

  15. I have been working with WordPress for only about 2 months and this whole thing of Google tags and analytics had me quite intimidated. I am soooo glad I ran across your video: Tag Manager is installed and working perfectly within 15 mins!

  16. Great tutorial, thanks. I have a quick question though, on one of my sites I am using a child theme and as such I cant add anything to the header.php, do i just adjust the parent theme? Thanks

  17. I can't see the Tag Assistant icon on the top right of the screen. What do I need to do to enable that?

  18. thank you so much, i just did it for the first time. its working. kindly let me know how to add JSON-LD mark up using google tag manager. if a video is already there, let me know the link. Thank you once again

  19. This was an awesome tutorial. Helped me with several sites then I discovered I could do everything through SEO Press Pro instead and cut out a bunch of steps. Hope it works the same because it's so much easier!

Leave comment

Your email address will not be published. Required fields are marked with *.