How to Add Google Analytics Tag in Google Tag Manager

How to Add Google Analytics Tag in Google Tag Manager

1. Google Tag Manager Set up

  1. Go to the Google Tag Manager website ([]( and sign in with your Google account.
  2. Create a new Google Tag Manager account for your website/application if you haven't already.
  3. Follow the on-screen instructions to set up your Web-container. A container is a snippet of code that needs to be added to your website/application.

2. Adding the Google Tag Manager code to your website/application

  1.  Once you've created the container, you'll be provided with a GTM container code snippet.
  2.  Copy the entire code snippet provided.
  3.  Paste the code snippet into the `<head>` section of your website's HTML code. This should be added before the closing `</head>` tag.
  4. Save the changes and publish your website/application.

3. Setting up a Google Analytics Tag in Google Tag Manager

  1. Go back to the Google Tag Manager interface.
  2. Access your container by clicking on its name.
  3. Click on "Tags" in the left sidebar menu.
  4. Click on the "New" button to create a new tag.
  5. Give your tag a descriptive name, such as "Google Analytics - Widget Click Event."
  6. Choose the tag type. For Google Analytics, select "Google Analytics: **: GA4 Configuration**."

  1. Configure the tag by specifying the Measurement ID of your Google Analytics property. You can find the Measurement ID in your Google Analytics account under Data Streams → Web stream details.

  1. Choose the appropriate track type based on your requirements, such as "Event" for tracking widget clicks.
  2. Set the tag firing option under Advanced settings to “once per page”.

  1. Save the tag.

4. Create a Trigger for the Tag

  1. Click on "Triggers" in the left sidebar menu.
  2. Click on the "New" button to create a new trigger.
  3. Give your trigger a descriptive name, such as "Widget Click Trigger."
  4. Select the trigger to fire on “Some Clicks”.
  5. Choose the “Click Element” trigger type, the condition as “matches CSS selector”, and the value as “.container__CompanyIcon-sc-qtelua-5.dmnmBT”.

  1. Save the trigger.

5. Preview and Debug

  1. In the Google Tag Manager interface, click on the "Preview" button in the top-right corner. This enables the preview mode.
  2. Open your website/application in a separate browser tab or window.
  3. With the preview mode enabled, any changes you make in Google Tag Manager will be visible in the preview pane.
  4. Navigate to the page where the widget is located and interact with the widget to trigger the event you want to track.
  5. In the preview pane, you'll see the tags and triggers firing, as well as the associated data being sent to Google Analytics.
  6. Use the debug information provided to ensure that the tag is firing correctly and capturing the desired data.
  7. If any issues are identified, go back to Google Tag Manager to make the necessary adjustments to the tag or trigger configuration.
  8. Repeat the preview and debug process until you're satisfied with the tracking implementation.

6. Publish Changes in Google Tag Manager

  1. Once you have created the tag and trigger, click on the "Submit" button in the top-right corner of the Google Tag Manager interface.
  2. Provide a version name and description for the changes you made.
  3. Click on the "Publish" button to publish the changes.

    • Related Articles

    • How to Publish Web Messenger by Using Google Tag Manager

      About Google Tag Manager (GTM) Google Tag Manager is a free tool that allows you manage and deploy marketing tags on your website or mobile app without having to modify the code. For more information you can visit their website. If you do not have an ...
    • How to Connect Google Dialogflow?

      To connect Google Dialogflow, you need to have a Google Dialogflow account. Please go to to create an account. Once you create your account, please go to Console. After that, click Create Agent button in the left menu. If you ...
    • How to Use Commerce Manager

      Prerequisites If your Facebook Business Page is a new page, please make sure it is verified (see How to Create a Facebook Business Manager (FBM)?). Set your page settings. Make sure that a minimum of 10/13 of page settings are completed. Go to “Meta ...
    • How to Create a Facebook Business Manager (FBM)

      The first thing you need to do is go to the Facebook Business Manager (FBM). Go to site and your business page. If you haven't opened an account yet, open an account for your business. Here, we recommend that an email ...
    • Commerce Manager Limitations

      Limitations For Commerce Manager 1- Overall Limitations 1.1- Missing Integration notification There must be an integration added to publish an assistant with the Commerce module. 1.2- Missing catalog notification There must be a catalog added to ...