Getting Started with Data-Driven Design Improvements on Your WordPress Website Using Google Tag Manager

By default, Google Analytics tracks pages. But to make data-driven design improvements, we’ll also want to track events, which will help us better understand how visitors interact with your website. Let’s begin with the setup and installation of Google Tag Manager for use with WordPress.

Google Tag Manager and Why It Matters

Once set up, Google Tag Manager makes it easier for non-developers to manage the code snippets that track and measure visitor behavior with Google Analytics. In this tutorial, we’re simply laying the groundwork for more advanced tracking later, so that we can make smarter design decisions.

Setting Up Google Tag Manager

  1. Sign in to Google Tag Manager using an existing Google account and create a new account for your company and website…

Setting Up Google Tag Manager

  1. For “Account Name”, type in your company name
  2. For “Setup Container”, type in your web address
  3. For “Where to Use Container”, choose “Web”
  1. Next, copy the Google Tag Manager snippet and log into your WordPress Dashboard with your admin account…

Google Tag Manager Snippet

Note: This snippet will replace your Google Analytics tracking code. Therefore you will need to remove your Google Analytics tracking code after you “preview and debug”.

  1. Be sure to have a recent backup of your website. Then, paste the Google Tag Manager code into your “header.php” file, just below the body tag (your file may look slightly different)…

Google Tag Manager Snippet pasted

  1. Go to: Appearance -> Editor
  2. Under “Templates” sidebar on right (not shown), click the “Header” file (header.php) link.
  3. Paste your Google Tag Manager code below body tag and Update the file

Creating Your First Tag

Add a New Tag to Your “Container”. This will require the entry of your Google Analytics Tracking ID…

Creating your first tag with Google Tag Manager

  1. Go to: Accounts -> Container Name (e.g., “”)
  2. Go to: “New Tag” (a.k.a., “Add a new tag”)
  3. For “Choose Product”, select “Google Analytics”
  4. For “Choose a Tag Type”, select “Universal Analytics”
  5. For “Configure Tag / Tracking ID”, enter your Google Analytics Tracking ID
  6. For “Configure Tag / Track Type”, select “Page View”
  7. For “Fire On”, select “All Pages”
  8. Create Tag

Preview and Debug

Test to make sure the tag is firing (i.e., working) on your website…

Debugging Google Tag Manager tag

  1. Go to: Accounts -> Container Name (e.g., “”)
  2. Go to: “Publish” menu and click on disclosure triangle
  3. Click on “Preview” button and visit your website
  4. After checking, go back to “Publish” menu and click on “Publish”
  5. Remove your Google Analytics Tracking code

Note: If you log into Google Analytics -> Real-time -> Overview, you should see at least one visitor on your website (you). Also, sometimes, you may need to revisit the Google Tag Manager dashboard to turn off “Preview” mode (so that you don’t continue to see the panel at the bottom of your web browser.

Is your WordPress website not converting like it should? Stop the madness and let me help. From new custom websites, to complete makeovers, to monthly maintenance. Learn more here.

Leave a Reply

Your email address will not be published. Required fields marked with an asterisk.