• Feedback:
  • phone
  • telegram
  • whatsapp
galaxy-star

29

June

2024

How to add Google Tag Manager code to WordPress

How to add Google Tag Manager code to WordPress

Google Tag Manager (GTM) is a powerful tool that allows you to easily manage tags and tracking codes on your website without the need for developers. Installing it on a WordPress site might seem like a daunting task, especially for beginners, but it's quite straightforward if you follow step-by-step instructions. In this guide, we'll cover two main methods for adding the GTM code to your WordPress site: manually and using the "Header and Footer" plugin. These methods will enable you to quickly and effortlessly integrate Google Tag Manager into your site, giving you full control over all tags and scripts.

Manual addition

1.Go to the admin panel of your site.

2.Go to "Appearance" -> "File Editor".

3.Open the header.php file.

4.Paste the first part of the GTM code directly after the <head> tag.

5.Open the footer.php file.

6.Insert the second part of the GTM code just before the closing </body> tag.

7.Save the changes to the files.

ga

Using the "Header and Footer" plugin

The easiest way to add GTM code to a site on WordPress is to use the "Header and Footer" plugin. To do this, follow the steps below:

1.Go to the admin panel of your site.

2.In the menu on the left, click on the "Plugins" tab and select "Add New".

ga

3.Type "Header and Footer" in the search bar, find the plugin called "Head, Footer and Post Injections" and install it.

ga

4.Copy the GTM code. To do this, go to the GTM website (tagmanager.google.com), click on the gear icon on the right.

ga

5.Go to the "Install Google Tag Manager" tab and copy the displayed code.

ga ga

6.Go back to the admin panel of your site. In the "Settings" section, open the installed plugin and paste the first part of the copied code into the top block of the plugin.

ga

7.Copy the second part of the GTM code and paste it into the second block of the plugin.

ga ga

8.Save the changes made in the plugin. Done!

If you find an error or inaccuracy in the text, select it and press Ctrl + Enter
Comments
    user-avatar