Quick summary
This tutorial shows how to generate a Google Tag Manager code snippet and install it on a WordPress site using the Header Footer Code Manager plugin. It covers every step from creating a GTM account and container to pasting the header and footer scripts into WordPress.
Steps
- Go to the Accounts tab in Google Tag Manager and click Create Account.
- Enter your Account Name, such as your company name.
- Add a Container Name, such as your website's domain.
- Click Create to generate the new container.
- Hit Yes to view the generated code snippet.
- Click the copy icon to copy the body code from the snippet.
- Use the provided link if you need to view the code snippet again later.
- In WordPress, go to Plugins and click Add New Plugin.
- Use the search bar on the Add Plugins page to find the right plugin.
- Search for HFCM and install the Header Footer Code Manager plugin.
- After installing HFCM, find it in the left panel and click Add New.
- Create the first snippet and name it to indicate the GTM Header.
- Set the Location dropdown to Header for this snippet.
- Paste the header code from Google Tag Manager into the code box and click Save.
- Add a second snippet for the Footer, name it, and set the location dropdown to Footer.
- Paste the footer code into the code box and click Save.
- Verify that the Status for both added snippets is set to ON.
.gif)
