Bhavsar hetvi Enrollment:236040316008
Practical-6
Aim: Use the Google Tag Manager to insert the tracking code in the sample
web pages of your website.
Google Tag Manager is a tag management system (TMS) that allows you to quickly and easily
update measurement codes and related code fragments (aka tags) on your website or mobile app.
These guides will get you up to speed quickly, so you can implement measurement code
successfully and make smart decisions on your ad spend.
Step 1: Set Up Google Tag Manager
1. Create an Account in GTM:
Go to Google Tag Manager.
Log in using your Google account.
Create a new GTM account and container.
Choose the target platform as "Web."
2. Get the GTM Code Snippet:
After setting up, GTM will generate a JavaScript code snippet.
Copy the provided <script> tags.
Step 2: Add GTM Code to Your Website
1. Open the HTML Files of Your Sample Web Pages:
Locate the HTML files where you want to insert the GTM tracking code.
2. Insert the GTM Code in the <head> Tag:
Add the first <script> snippet immediately after the opening <head> tag.
3. Insert the No-JS Code in the <body> Tag:
Add the second <noscript> code immediately after the opening <body> tag.
Amazon:
Bhavsar hetvi Enrollment:236040316008
Subject Name:Essential of Digital Marketing
Snapdeal:
Key Components of GTM
1.Container:
A container is a code snippet you place on your website or app. It acts as a "holder" for all your
tags, triggers, and variables.
2.Tags:
Tags are snippets of code or tracking pixels used to collect data or integrate third-party tools.
Examples include:
o Google Analytics o Google Ads Conversion Tracking
3.Triggers:
Define when and where a tag should fire. For example:
o Fire a tag on page load.
o Fire a tag on button click or form submission.
Bhavsar hetvi Enrollment:236040316008
4. Variables:
4.Variables :
Common types include:
o Predefined Variables (e.g., Page URL, Click URL) o
User-defined Variables (e.g., Custom JavaScript)
5.Data Layer:
A data layer is a JavaScript object that GTM uses to store and manage structured data, such as
user information or product details, which can be passed to tags.
Subject Name:Essential of Digital Marketing
Bhavsar hetvi Enrollment:236040316008
Subject Name:Essential of Digital Marketing