How to Install Google Tag Manager on your Wordpress Using Plugin

Google Tag Manager is a free way to manage all of the tracking code needed on your website.
Unless you are proficient with modifying WordPress Themes, is how to install Google Tag Manager in a WordPress site.

Create a Google Tag Manager Account and a Container for your Website :

Create a Google Tag Manager account.

Now create a container, where you will store all the tags for your WordPress website. Use the name of your website as the name of this container (You may have other containers in the future for other websites). Choose “Web” for “Where to Use Container”.

Create a new container for your WordPress site. Go to the Admin section, and from the Container select “Create Container”.

Now your container is set up, open it and go to Admin.Now Click on the gear symbol next to “Install Google Tag Manager”.

This is the code snippet,now just copy the GTM Id and paste that in WordPress Plugin

Log in to WordPress dashboard and navigate to Dashboard > Plugins

Click on Add New > and add this plugin DuracellTomi’s Google Tag Manager for WordPress

Activate the plugin and go to settings at your dashbaord

Click on Google Tag Manager where you can find the dashboard of Google Tag Manager

Paste the code,and select the options ,

Footer of the page (not recommended by Google, no tweak in your template required)
 Custom (needs tweak in your template)
 Codeless injection (no tweak, right placement but experimental, could break your frontend)
 Off (only add data layer to the page source)

Select how your container code should be included in your website.
If you select ‘Custom’ you need to edit your template file and add the following line just after the opening <body> tag:
<?php if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) { gtm4wp_the_gtm_tag(); } ?>

Note : Codeless injection doesn’t effect your theme in many cases,it places the code exactly.

If it effects your theme go and use custom tag and just place the php function in the body tag at the starting.

you can place it either at the child theme or main theme,in both cases it works fine

Testing Google Tag Manger is installed correctly or not using Tag Assistant

Now Test that Google Tag Manager is Correctly Installed in WordPress

Now use Tag Assistant (by Google) to make sure that Google Tag Manager is installed correctly.

Open the Chrome browser, and install Tag Assistant. Once Tag Assistant is installed, simply navigate to a page on your site, and click on the tag icon at the top of your browser. You should see a green tag labeled “Google Tag Manager”, indicating that GTM has been successfully installed.

That’s it now you can see that the Tag was Added Successfully.

Thank you please visit again..!!!

Leave a Reply

Looking for a Top Rated* Marketing Company?

Contact us at +1 630 999 SPOT (7768) or submit a business inquiry online.

Looking for a top rated* digital marketing and advertising company?