How to Setup Google Tag Manager from Scratch
- Account Setup and Container Creation:
- Sign Up: Create a Google Tag Manager account if you don’t have one.
- Create a Container: Set up a new container for your website or app, and choose the platform (web, iOS, Android).
- Install Container Snippet:
- Generate Container Snippet: GTM provides a container snippet to be added to your website.
- Add to Website: Place the container snippet in the <head> and <body> sections of your HTML.
- Configure Tags:
- Add Tags: Tags are snippets of code or tracking pixels. GTM supports a variety of tags, including Google Analytics, AdWords, and custom HTML.
- Choose Tag Type: Select the type of tag you want to add and configure its settings.
- Define Triggers:
- Create Triggers: Triggers define when and where tags should fire. They can be based on events like page views, clicks, form submissions, etc.
- Set Trigger Conditions: Specify conditions that must be met for the trigger to activate.
- Set Up Variables:
- Create Variables: Variables store data used by tags and triggers. GTM provides built-in variables (e.g., page URL, referrer) and supports custom variables.
- Publish Container:
- Preview and Debug: Use the GTM Preview mode to test your configuration.
- Submit and Publish: Once you’re satisfied with the setup, submit and publish the container to make the changes live.