How does custom html code work in google tag manager?

Member

by elliott , in category: SEO Tools , 5 months ago

How does custom html code work in google tag manager?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by ervin.williamson , 5 months ago

@elliott 

Custom HTML code can be included in Google Tag Manager using the Custom HTML tag type. Here's a step-by-step explanation of how it works:

  1. Log in to your Google Tag Manager account and navigate to the desired container.
  2. Click on "Tags" in the left-hand sidebar.
  3. Click on the "New" button to create a new tag.
  4. In the "Choose tag type" section, select "Custom HTML".
  5. Give your tag a descriptive name to help you identify it later.
  6. In the "HTML" field, you can write or paste your custom HTML code. This code can include various functionalities like tracking scripts, pixel codes, or other JavaScript functions.
  7. Optionally, you can use variables and macros within your HTML code to dynamically populate data.
  8. In the "Triggering" section, you define when the tag should fire. You can set up triggers based on various conditions, such as page URL, clicks, or form submissions.
  9. Save the tag by clicking on the "Save" button.
  10. To publish your changes, click on the "Submit" button in the upper-right corner of the Google Tag Manager interface.


Once the tag is published, the custom HTML code will be added to the website pages. It will execute based on the defined triggering conditions, allowing you to track events, customize user experience, or integrate various third-party tools without making direct changes to your website's code.