Configuring custom HTML tags in Google Tag Manager (GTM) allows you to add custom JavaScript or HTML code to your website. Here’s how you can set it up:
1.Create Google Account
-
- Go to Google Tag Manager and log in with your account.
2. Create a New Tag:
-
- In the GTM dashboard, select the container you want to work with.
- Click on Tags in the left-hand menu.
- Click on New to create a new tag.
3. Configure the Tag:
-
- Click on Tag Configuration.
- Select Custom HTML from the list of tag types.
4. Add Custom HTML/JavaScript:
-
- In the Custom HTML text area, paste your custom HTML or JavaScript code.
- Ensure that the code is correct and does not have any syntax errors.
- In the Custom HTML text area, paste your custom HTML or JavaScript code.
5. Set Up Triggers:
-
- Click on Triggering to specify when the tag should be fired.
- Select an existing trigger or click the + icon to create a new one.
- Choose a trigger type (e.g., Page View, Click, Form Submission) and configure it according to your requirements.
- Click Save to add the trigger.
6. Save the Tag:
-
- After configuring the tag and adding triggers, click Save.
- Give your tag a name (e.g., “Custom HTML Tag”) and click Save again.
7. Publish the Container:
-
- Click on Submit in the top-right corner of the GTM interface.
- Add a version name and description for the changes you’re publishing.
- Click Publish to make the changes live on your website.
8. Test the Tag:
-
- Use the GTM Preview mode to test your tag before publishing.
- Click on Preview in the top-right corner.
- This will enable the preview mode, and you can navigate to your website to see the tags in action.
- Check the GTM debug console to ensure the custom HTML tag is firing correctly.
By following these steps, you can effectively configure and deploy custom HTML tags in Google Tag Manager. This allows you to add any custom code needed for tracking, third-party integrations, or custom functionalities on your website.