How to add gtm code directly in web page?

Member

by bertha , in category: SEO Tools , a year ago

How to add gtm code directly in web page?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by rusty.rosenbaum , a year ago

@bertha 

To add Google Tag Manager (GTM) code directly to a web page, you need to follow these steps:

  1. Sign in to your Google Tag Manager account or create a new one.
  2. Create a new container by clicking on "Create an Account" or selecting an existing account.
  3. Set up a new container by entering a name and selecting the appropriate target platform (Web, iOS, Android).
  4. Once your container is created, you will be provided with two code snippets - one for the head section and another for the body section of your web page.
  5. Copy the entire code snippet provided for the head section of your web page.
  6. Open your web page's HTML file in a text editor or any suitable editor.
  7. Paste the copied code snippet into the head section of your HTML file, just before the closing tag.
  8. Save the changes made to your HTML file.
  9. Copy the code snippet provided for the body section of your web page.
  10. Paste the copied code snippet into the body section of your HTML file, just after the opening tag.
  11. Save the changes made to your HTML file.
  12. Make sure to publish your container in Google Tag Manager to activate the tags, triggers, and variables associated with it.


Note: It is recommended to add the GTM code to all the pages of your website to ensure tracking is consistent across all relevant pages.