Digital Marketing

How to Setup Google Tag Manager on Different Platforms?

By Muhammad Hanzla Ijaz

Google Tag Manager is a script or tag management tool that allows the user to add marketing tags or snippets of codes on the website easily. GTM is free and you can try to learn without risking heavy amounts. In this blog post, you will learn how to set up Google Tag Manager, how to set up google analytics in tag manager, how to set up google tag manager in WordPress and much more.

Did you know that 25,400,558 live websites are using Google Tag Manager currently?

How to Set Up Facebook Pixel in Google Tag Manager?

In 2019, the only way to install Facebook Pixel via Google Tag Manager was by using a Custom HTML tag template. That means you need to know JavaScrip code in order to do that. However, now it is much easier and simple to add Facebook Pixel to Google Tag Manager. 

  1. Log into your Google Tag Manager account. 
  2. In Google Tag Manager, go to Templates, click on Tag Templates and search for Search Gallery in the search field. 
  3. Type in Facebook and then click on Facebook Pixel.
  4. You will see a new template: Tags>New>Custom section.
  5. On the Facebook Pixel – Pageview, enter the Pixel ID and set the tag to fire on All Pages under Triggering.How to setup facebook pixel
  6. Find and click Save located at the upper right corner.
  7. To make it more optimal, go to Variables, click on User-Defined Variables and then to Constant paste your Facebook Pixel ID. And save the variable. You can reuse that same variable every time you need it. FB Pixel IDFacebook Pixel Setting Up
  8. Go to the Facebook Pixel-Pageview, and insert the variable you just created instead of the plain Pixel ID.Using Pixel ID of Facebook in GTM
  9. To test the Facebook Pixel Tag, enable the Preview and Debug Mode, and refresh the page.  
  10. Click on the Page View at the bottom of the screen to make sure your Facebook Pixel tag has fired.

How to Set up Facebook Pixel to Google Tag Manager Manually?

Follow the steps mentioned below to manually set up the Facebook Pixel to GTM.

  1. Log into your Google Tag Manager account.
  2. Click on the Tags and then click on New.
  3. Name your tag for instance Facebook-Pixel.
  4. Click on Custom HTML under the Tag Configuration.
  5. Paste the Facebook Pixel Code in the HTML box.
  6. Click on the All Pages trigger under the Trigger.
  7. Click on Save at the upper right corner of the screen.

How to Setup Google Tag Manager on Shopify?

Follow the step-by-step detailed guide to set up GTM on your Shopify store.

  1. Install GTM to get the code snippets, if you do not have Google Tag Manager installed, sign up for the GTM account and get the tracking code right away.Sign in GTM and get code
  1. If you already have the GTM account for your e-commerce store, you can find these code snippets by clicking on the Admin on the top navigation and then clicking on Install Google Manager.
  2. Copy the first piece of code snippet, copy everything between script tags and do not include the actual tag. If you are using the GTM for the first time, publish your GTM container by clicking on Submit and then Publish.
  3. Copy the tracking code as well. If you are using the GTM for the first time, publish your GTM container by clicking on Submit and then Publish.
  4. Now, login to your Shopify Store and click on Preferences under Online Store.installing GTM on Shopify
  5. Click on Add Custom JavaScript to Google Analytics.
  6. Paste the first piece of code and click on Save.
  7. Click on Themes under Online Store.
  8. Click on Actions and then Edit Code.
  9. In the search bar, look for “theme.liquid file”.
  10. Paste the first code snippet you got from GTM into the head tags of your theme.liquid file.
  11. Search for the “checkout.liquid” file on the search bar.
  12. Paste the first code snippet you got from GTM into the head tags of your checkout.liquid file.
  13. Similarly, paste the second code snippet in the body of your theme.liquid file.
  14. Paste the second code snippet in the body of your checkout.liquid file.
  15. Go to Shopify admin and click Save.
  16. Go back to GTM, and proceed to install the Google Tag Manager. Avoid adding the following types of tags during installation:
  • Universal Analytics for Google Analytics
  • Facebook Pixel
  • Classic Google Analytics for Google Analytics

How to Setup UA in Google Tag Manager?

To deploy the Universal Analytics with Tag Manager follow the steps below:

  1. Go to Your Google Tag Manager and log in.
  2. Tap on Variables. You can find them at the left of the screen.
  3. Click New under User-defined Variables.
  4. Name your variable, for instance, Google Analytics – Universal Analytics Code.
  5. Select and add the “Google Analytics Settings” variable type.
  6. Select and add your Universal Analytics Tracking ID.
  7. You can enable different Google Analytics plugins under the More Settings dropdown. 
  8. Click on Save in the upper right corner.

Add UA Tags to Google Tag Manager

  1. On the left side of the screen click on Tags, and then click on New.
  2. Name your tag such as Universal Analytics.
  3. Under Tag Configuration click on Google Analytics-Universal Analytics tag type.
  4. Select Page View under the Track Type.
  5. Select All Pages under the Triggering.
  6. Click on Save in the upper right corner.
  7. To make it Live on the website click on Submit in the upper right corner.
  8. And then click on Publish.
  9. You can also preview the changes using GTM Preview Mode.

How to Setup GA4 in Google Tag Manager?

  1. On the left side of the screen click on Tags, and then click on New.
  2. Name your tag such as GA4 Tags.
  3. Under Tag Configuration click on Google Analytics-GA4 Configuration tag type.
  4. Tap on Page View under the Track Type.
  5. Enter the Measurement ID. 
  6. Click on the, Send a page view event when this configuration loads, checkbox.
  7. Tap All Pages under the Triggering.
  8. Click on Save at the upper right corner.

How to Setup Google Tag Manager in WordPress? 

Set up Google Tag Manager in WordPress in these easy steps:

  1. Login to your Google Tag Manager account.
  2. Copy the code beside the Workspace Changes on your GTM homepage. 
  3. Login to your WordPress account and navigate to Appearance and then click on Theme File Editor. 
  4. Click on Theme Files on the right side.
  5. Click on header.php and paste the snippet code from GTM to the tags to change the header section. 
  6. Paste the code to the tag as well.
  7. Click on the Update File at the bottom of the page to save changes.
  8. Once you’re finished with adding snippets to your WordPress website, go back to your Google Tag Manager dashboard and click Preview.
  9. It will direct you to a new window to connect Tag Assistant to your website. Enter your site URL and click Connect.
  10. A new window to your site will open, and Tag Assistant will notify you of the successful Google Tag Manager connection. Click Finish, navigate to the preview window, and click Continue.
  11. You will see the Google container found notification along with your Google Tag Manager container ID, meaning the installation of Google Tag Manager on your WordPress website is complete.
  12. Close the preview and click on Submit and then Publish.

Conclusion

Google Tag Manager is a tracking tool for managing and deploying the tags on your website. This article gives you detailed instructions on how to set up Google Tag Manager for different online platforms such as the Shopify store and WordPress. And two methods of setting up Facebook Pixel in GTM.

How to Setup Google Tag Manager? – Frequently Asked Questions

Where is Google Tag Manager ID?

In the Google Tag Section of Google Ads or Google Analytics account, the tag ID is displayed under the Google tag on the left side. A single tag can have multiple tag IDs. The first ID is the main ID, but the IDs can be used interchangeably when adding the Google tag to your website. 

How do I know if Google Tag Manager is installed?

The easiest way to check if the GTM is installed is through the source code in the browser.

  • Go to the website you want to check.
  • Right-click on the background and a drop-down menu appears. Click on the View page source.
  • A new tab will open. Press Ctrl+F, and it will open a search dialogue box.
  • Type in gtm.js, if the GTM is installed, you will see at least one occurrence with gtm.js text surrounded by

Also Read:

References:
Google Tag Manager Usage Statistics – BuiltWith