Complete guide to setup GTM Google Tag Manager

What is Google Tag Manager? Setup for WordPress & Custom Sites

What is Google Tag Manager (GTM)?

Google Tag Manager is a free tool provided by Google that allows you to add and manage marketing and analytics tags (code snippets) on your website or mobile app without editing the code directly.

Why Should You Use Google Tag Manager?

I am giving you some practical and real examples that will tell you why should use Google Tag Manager. If you’ve ever faced these situations, you’ll instantly relate. Let’s say you’re working for an organization, company, or client, it’s likely that their website is custom coded and built by a developer or it’s built on a CMS platform built by a wordpress developer.

Why Performance Marketers Should Use Google Tag Manager
 

 

Google Analytics Integration

If you want to connect Google Analytics to your website so that you can see detailed data and insights about your website visitors, it is possible that the website has been created by a developer and Google Tag Manager is not connected to that website, so to connect Google Analytics, first you will send the code to the developer, then developer will add it to the header, do testing and then you will check in the debug view in Analytics whether Google Analytics is connected to the website or not. Till then you will have to wait and there is also dependency on the developer in this. Which takes a lot of time.

Tracking Form Submissions events in GA4

Suppose you have connected Google Analytics to your website. There are 2 different forms on your website. After submitting the 1st form, the user goes to the thank you page. And after submitting the 2nd form, a confirmation message is displayed on the same page. In this case the page does not change. Now you are thinking that the form submission event should be tracked in Google Analytics when the user submits the form. Then for this also you will have to tell the developer. If you want to track such an event in Google Analytics like someone has scrolled 50% of the page or your website has a chat button and you are thinking that as soon as someone starts a chat, the chat started event should come in Google Analytics, then for this also you will have to talk to the developer if Google Tag Manager is not connected to your website.

Connect Facebook pixel to your account

Now you have to connect the pixel of your Facebook Ads account to your website so that you can track the performance of Facebook Ads. Now to connect this, you will have to send the pixel code to the developer. Then the developer will add it, test it and then you will check whether the Facebook pixel is connected to the website or not. In this, you will be dependent on the developer if Google Tag Manager is not connected to your website. If due to some mistake, it is not connected properly, then you will have to tell it that the pixel is not connected. Which takes a lot of time.

Track custom events in facebook ads manager

You have connected the pixel of your Facebook Ads account to your website. Now if you are thinking of adding any custom event like purchase with dynamic value should be added to your Facebook ads so that such events can be tracked with proper value. And if you want to send many different custom events in your Facebook ads as per your business requirement then you will have to talk to the developer if Google Tag Manager is not connected to your website.

Conversion tracking in Google Ads

Same is the case with Google Ads as I have told you in the above case. If you want to connect Google Ads conversion tag to your website then you will have to ask the developer to connect it if Google Tag Manager is not connected to your website.

Now you must have understood why you should use Google Tag Manager and if you are not using it then what will you have to face. Once you connect Google Tag Manager to your website then your dependency will almost be removed from the developer and you can manage all the tags yourself as per your requirement. Once connected, you will not have to bother the developer again and again.

 

What Can You Do with Google Tag Manager?

You can do many things using Google Tag Manager such as

Managing Multiple Tracking Scripts

From Google tag manager you can connect Facebook Pixel, Google Analytics, Google Ads Conversion Tracking, LinkedIn Insight Tag, or any custom script to your website without bothering the developer again and again.

Tracking Events like Button Clicks, Form Submissions, Scroll Depth

If you want to know whether the user clicked on a button, submitted a form, or scrolled the page or not, you can do all this with Google Tag Manager. Which you can view in Google Analytics 4 or other tools.

Conversion Tracking

With Google Tag Manager, you can easily track conversions of Facebook Ads, Google Ads, or LinkedIn Ads. Track Google ads Conversion, Fire Facebook Pixel Events, Count Whatsapp clicks as conversion and many more.

Adding Custom HTML & Scripts

Sometimes there is a tool that does not have direct integration in GTM (like a 3rd party chatbot or call tracking tool). In such cases, you can manually add scripts using Custom HTML tag. GTM gives you full flexibility.

Setting Triggers

Triggers are a powerful feature of GTM. You can define: This tag should fire when a button is clicked When a user visits a specific page When a file is downloaded (like a brochure) That is, you can control the behavior of every tag.

Preview and Debug Mode

Before going live, you can use the Preview Mode in GTM to see: Is the tag firing or not Is the trigger working correctly or not Is there any error occurring? That means you can test everything without going live.

Version Control

Every time you change something in GTM, it creates a new version. If something goes wrong, you can easily rollback to the old version.

E-commerce Tracking (Enhanced conversion)

If you have an e-commerce website (like Shopify, WooCommerce), then with GTM you can track events like: Product views Add to cart Purchase And many more events as per your business requirement or if you set up Enhanced E-commerce, then you get even deeper data.

How to Create and setup a Google Tag Manager Account?

If you want to connect Google Tag Manager to your website, then first you have to create an account in Google Tag Manager. Some steps are given below, by following them you can create an account of Google Tag Manager.

How to create Google Tag Manager Account

Step 1: Go to Google Tag Manager Website https://tagmanager.google. Before visiting the Google Tag Manager website, make sure you are logged in with your Google account.
Step 2: Click on "Create Account" When you visit the website, you will see an option “Create Account” – click on it.

Setup account details in Google Tag Manager Account

Step 3: In Account setup Enter your account Name. This is usually your business name. Example: My Company, DigiTechGrow, ABC Pvt Ltd, etc.
Step 4: In Country Enter your business's Location like India, United State etc. Below this you will see a checkbox you can tick it if you want sharing anonymous data with Google to improve their services.
Step 5: After account setup, Now you have to setup GTM Container. Enter Container name It should be your website url (don't include http / https) or project name. Ex: www.digitechgrow.com.

Google Tag Manager Container Setup

Step 6: Now select your Target Platform where you will be using the container. Available options given below

  • Web: Select web if you want to use GTM on a website. This is the most common choice.
  • iOS: Select this option if you're adding GTM to an iOS mobile application.
  • Android: Select this for Android mobile applications to implement tags via Firebase or custom setup.
  • AMP: For websites using Accelerated Mobile Pages (AMP) HTML framework.
  • Server: Select for server-side tagging setup using GTM Server Container, offering more control, speed, and privacy.

Step 7: After filling all the fields, click on the Create button.
Step 8: Accept the terms of Google tag manager. Read it and click Yes to accept.

Google tag manager terms of service

Step 9: When you accept the Google Tag Manager Terms of Service, your GTM account will be successfully created but it is not yet connected to the website, the account has just been created. As soon as the account is created, you will get a code from the end of GTM on the dashboard which has to be pasted in the head and body of the website.

Google tag manager head and body code snippet

What is Google Tag Manager Code and GTM ID?

GTM (Google Tag Manager) code is a JavaScript snippet that you need to install into your website's HTML - in order for the Google Tag Manager proper to work. After creating a container in Google tag manager, you’ll receive: A GTM Code Snippet (2 parts: head and body).

Click on GTM ID to get code snippet

GTM ID is a unique code that identifies your container. It looks something like this: GTM-ABC1234, which uniquely identifies your container.

Difference between GTM Code and GTM ID

Element Purpose
GTM Code This loads the Google Tag Manager script onto your site.
GTM ID It tells you which container is being loaded.

 

 

Where to Place GTM Code on Your Website

GTM provides two parts of the code:
Head Tag Code → Place inside the head of your HTML. Body Tag Code → Immediately after the opening body tag.
This ensures GTM loads early and works with most tags effectively.

How to Connect GTM with Your Website (3 Methods)

Connect GTM For Custom Coded Websites

If you're working with a custom-coded website, you'll need to inform your developer about the correct placement of the Google Tag Manager (GTM) code.
You need to tell the developer:
1. The GTM "head" code snippet must be placed inside the head section of the website.
2. The GTM "body" code snippet must be placed immediately after the opening body tag.
3. These snippets should be present on every page of the website.
On some pages like checkout, thank you, or purchase confirmation, the site's standard header may not be loaded due to custom templates or performance optimization. In such cases:
Make sure to check whether the head and body GTM codes are being loaded. If not, you or your developer will need to manually add the GTM code to those specific pages. You can identify such pages.

How to add google tag manager code in wordpress website (Using Plugin)

1. Install & activate "GTM for WP" plugin.

Install GTM for WP Plugin in WordPress to connect GTM

2. After logging into WordPress admin panel, go to Plugins, click on Add New Plugin and search GTM for WP. Click on Install and activate plugin.
3. After installing and activating the plugin, you will find the option of Google Tag Manager in the settings in the admin dashboard. Click on it. There will be a general option availabe enter the Google tag manager ID. After that, another option Container code ON/OFF Select on then click on the off option in container code compatibility mode and save it. After doing this, your GTM account will be connected to your WordPress website.

Setup Google Tag Manger using GTM for WP plugin's setting

How to add google tag manager code in wordpress website (Without Plugin)

1. Log in to your WordPress admin panel.
2. Navigate to Appearance > Theme File Editor.
3. In the Theme Editor, locate your active theme and open the header.php file and if you are using child theme make sure all changes should be in your child theme other wise when you update your parent theme changes will be override.

In WordPress paste GTM head code in header file

4. Paste the GTM head code snippet just before the closing head tag and click save changes.
5. Then, open the footer.php file and paste the GTM body code snippet just before the closing body tag and click save changes.

In WordPress Paste GTM body code in footer file

Once done, GTM will be successfully connected to your WordPress website.

How to check if google tag manager is working

1. Use Tag Assistant (by Google) Chrome Extension:
Install and activate the extension.
Visit your website and click the extension icon.
It will show whether GTM is detected and working.
2. Check in the website’s source code (Right-click > View Page Source) – Search for GTM-XXXXXXX.
3. After connecting GTM to your website, go to the Google Tag Manager dashboard. At the top of the page, click on your GTM ID (e.g., GTM-XXXXXXX). A popup will appear containing both the head and body code snippets.

Verify GTM is connected and working or not

 

Below the code, you’ll see an option to check your installation. Enter your website URL in the field provided and click the Check button.
If GTM is installed correctly, a green checkmark will appear with a success message.
If it's not connected properly, you’ll see a “Not detected” message. This helps verify that your GTM code is working and properly integrated into your site.

 

Frequently Asked Questions

Everything you need to know about Google Tag Manager, from basics to advanced implementation

What is the purpose of Google Tag Manager?

Google Tag Manager helps you manage and deploy marketing tags (snippets of code) on your website or mobile app without modifying the code directly. It simplifies tag management for marketers and developers.

Is Google Tag Manager free to use?

Yes, Google Tag Manager is completely free to use for websites and apps. There\'s also a premium version (GTM 360) for enterprise needs, but the free version is more than enough for most businesses.

Do I need coding knowledge to use Google Tag Manager?

Basic GTM tasks like installing tags or triggers can be done without coding. However, for advanced tracking (like custom event tracking), some basic understanding of HTML/JavaScript is helpful.

What's the difference between Google Tag Manager and Google Analytics?

Google Analytics is a tool to collect and analyze data. GTM is a tool to manage and deploy tags like Google Analytics, Facebook Pixel, etc. GTM can send data to Analytics.

Is it safe to use Google Tag Manager on my website?

Yes, GTM is secure if managed properly. Always give GTM access only to trusted team members and audit container versions regularly.

Can I use multiple GTM containers on a single website?

Technically yes, but it’s not recommended. It can cause conflicts and tracking errors. Ideally, use one GTM container per website.

How long does it take for GTM changes to reflect on the website?

Changes made and published in GTM are usually reflected immediately. However, always use Preview Mode to test first.

Do I need to reinstall GTM if I change my website theme?

Yes, if you had manually inserted the GTM code in your theme files. If you used a plugin, the GTM code usually remains intact.

What kind of tags can I manage through GTM?

You can manage multiple tags like: Google Analytics Google Ads Conversion & Remarketing Facebook Pixel LinkedIn Insights Custom HTML or script tags

Can GTM slow down my website?

No, GTM is asynchronous and doesn’t block page load. However, the tags inside GTM can affect performance if not managed properly.

What happens if I remove the GTM code from my site?

If GTM is removed, all tags managed via GTM will stop working, including Analytics, Pixels, etc. You’ll lose tracking and marketing data.

Make your Digital presence with Confidence

Grow your business with best performance marketing strategy

Send WhatsApp message