WordPress can easily be integrated with Google Analytics 4, which lets you see how visitors interact with your site. But there are other tools that can help you improve your site’s performance. One example is Google Tag Manager, which lets you add tags to your site without writing any code.
Install Google Tag Manager.
- Visit https://tagmanager.google.com/ > Click Accounts > Create Account.
- Name your account. Think of this from a high level, give a name like your business name.
- Next, it’s time to name your container. Your container is usually used for one website so it’s good to give this a name that relates to your website(s) that you are installing GTM on.
- Select the type of content: Web, AMP, Android, or iOS. If setting up a mobile container, select whether you’re using the Firebase SDK or one of the legacy SDKs.
- Click Create
- Be sure to agree to the Terms of Service.
Add it to your site.
Copy your Head snippet.
Now here’s the tricky part ideally, you only want to add this snippet once so your GTM container will be on your entire site. Each WordPress site will have a different way of adding this script to your site. While you may have access to your headers.php and footers.php files this can create issues unles you know exactly what you are doing. A more reliable way is to use a plugin that gives you access to the head and body.
When adding the head code get it as high in the head code as possible. This let’s Tag Manager be the first to interact with the page and run its tags.
Copy your Body (noscript) snippet.
Place the Body code snippet immediately after the <body> tag in your HTML output. Again our goal is to get it as high in the code as possible.
You did it!
Create your tags.
If you want to add a new tag, simply click “Create a new tag.” This will open up a slide window where you can name the tag and choose what type of data you would like to collect. Select your trigger and Save.
This video helps explain creating tags in more detail.
You’re WordPress site is ready!
If you’re new to GTM, you might not realize how much power it has. In fact, there are so many options available that it can be overwhelming at first. Fortunately, Phantm Marketing has experts to help you get more out of your Google Tag Manager Account. Contact us today!