Discover How To Add GTM To Your WordPress Website

Table of Contents
    Add a header to begin generating the table of contents

    Do you have a WordPress website?

    Do you have GTM installed?

    If working with code isn’t your strong suit, then utilising GTM could be a great option for you, as you’ll be able to make all the changes you need, without having to edit a single line of your site’s code. 

    This blog will offer you step-by-step guidance on how to add GTM to a WordPress website – the end result of following this blog should be having Google Tag Manager installed without any issues.

     

    Benefits 

    • By utilising GTM, you are able to able to add and control several pixels and tracking codes without having to make any changes to the site’s code. 
    • Another benefit of adding GTM is that you only have to complete this process once when you install the software. 
    • This is a process that you only need to do once – when you install GTM.

     

    Setting up

    1. You will now need to download the free Google Tag Assistant Chrome Extension
    2. Google Tag Manager – you will need sign up for this
      1. After doing this, you would need to log into your Google Account – if you haven’t created a GTM account before, then you will be prompted to do this. 
        1. When setting up the account and container, you can use the name of your company or website. 
        2. Click “Web” – you will find it in the “Where to Use Container” section 
      2. You will see the terms and conditions – ensure you have read and accepted them.
      3. Now, you will be able to see a GTM code – this is not something you’ll need for the method used in this blog post. 
      4. When your Workspace is visible, you should write down your GTM ID.
      5. To publish your GTM container, you will need to click the following in this sequence:
        1. Submit 
        2. Publish 
        3. Continue

     

    Install & Acquiring the GTM WordPress plugin 

    1. You will need to access your WordPress account 
    2. When you see the WordPress sidebar, you will need to select “Plugins” and then “Add New”
    3. Once you’ve done this, you will need to type “Google Tag Manager for WordPress” in the search box.
    4. “DuracellTomi’s Google Tag Manager for WordPress” – install this plugin, and then activate it.
    5. Now look at the WordPress sidebar, and click on Settings, and then Google Tag Manager
    6. You will need to make sure that you paste your GTM ID into the shown field (the ID from the GTM dashboard).
    7. You will need to choose this container code placement: “Custom (needs tweak in your template)” – once you’ve done this, click “Save Changes.” 
    8. The plugin will have provided you with a PHP code, you need to copy this and then select “Save Changes”
    9. Look at the WordPress sidebar, click on “Appearances” and then “Editor”
      1. It is important that the theme you are editing is the one you have installed on your website.
      2. To ensure it’s the right one, you can go to “Themes” you find this in “Appearances”, this will then allow you to check the name.
    10. You will see a list on the right, select “Theme Header” Template
      1. The template that you have will be different as it is changed based on the theme that you have chosen to use.
      2. Find the opening <body> tag in the code, once you’ve done this, you will need to put the PHP code  (it’s the same code you got from the plugin) under this opening. Now select “Update File”

     

    Quality Assuring the Installation 

    Using Chrome, open the homepage of your website, once you’ve done this, you will need to select the Google Tag Assistant Chrome Extension, you will see an “Enable” button – click it.

    Once you’ve refreshed the page, you will need to click the Google Tag Assistant Chrome Extension to see if there is a green tag. 

    If you see the tag, then this means that the installation was successful.

     

    And… you’re done!

    You have now successfully added GTM to a WordPress Site.

    We hope that you found this blog useful and appreciate you reading. 

    If you want to keep updated with our future blogs, then make sure to check us out on social media so you can keep updated. 

    Posted in