Google Analytics collects visitor data and displays it in the form of reports, whereas Google Tag Manager takes hold of website interactions and sends such data to Google Analytics or any other tracking tool.
Getting Started with Google Tag Manager
Click on Google Tag Manager and sign in with your Gmail account to get started.
fig(a)-Set up a Tag Manager Account.
Install a Tag Assistant plugin within chrome –
- to check, analyze and solve installation of various Google tags such as Google Analytics, Adwords Conversion Tracking, Google Tag Manager etc.
- verify correct installation of Google Tags on your page.
- to show which tags are present, report any errors and suggest ways to improve implementation.
- Tag Assistant Recording records user flow through your website and troubleshoot, diagnose and validate issues regarding google analytics implementation.
fig(b)-Set up a Container
fig(c)- Google Tag Manager code to be placed in each page of your website.
fig(d) shows page containing code under the opening head tag of header.php file.
fig(e)- shows page containing code under the opening body tag of header.php file.
- one website, one container
- multiple websites, one container
- multiple websites, multiple containers
fig(1)-In Workspace overview screen, click the new tag.
Workspace: Every container creates a workspace by default that helps to make changes if any to your container. It becomes a part of Google Tag Manager when this workspace is converted to a version.
fig2-Click tag configuration and choose Universal Analytics & use Page View for Track-Type.
A tag is a Snippet of code that gets executed on a page. Tags send tracking info from your website to a third party eg Google Analytics Tracking Code, Facebook Pixel or Remarketing Tags.
fig3-Give a name for the variable- Google Analytics and enter your Google Analytics tracking code ID.
Variables are used to store information to be used by tags and triggers
- as a value condition for any given trigger.
- as a value that is passed within the tag that is fired.
There are two types of variables-
- built-in variables which are the default installation with the creation of a tag container
- user-defined that can be created and customized.
Start by creating three specific User-Defined Variables.
User-Defined Variables Tables show variables gaDomain & gaProperty that match your property in Google Analytics.
These two variables combine into a variable Google Analytics Settings that can be used within your tags. By stating the Google Analytics property as a variable, the same information can be used in multiple tags which make bulk changes easier whenever you are required to adjust Google Analytics information.
fig 4-After adding Google Analytics Tracking Code save the tag set up.
fig 5a-Click the + icon in Triggering [fig2] and choose Page Views
fig6-Workspace showing tag as Google Analytics Universal Analytics, trigger as All Pages and variable as Google Analytics.
Google Tag Manager has a feature called the Preview Mode where we can view where the Tag Manager has fired different tags.
fig7-After tag, the variable trigger is set to All Pages then add a description and click on the submit button in the workspace.
fig8- Go to the site and click the chrome plugin-Google Tag Assistant, which will display Global site tag & Google Tag Manager.
fig9-On the website page in the google tag manager console you will find a display of Summary showing that tags are fired on this page.
fig10-In Real Time Reports in the overview you will see that the page has been triggered.
Set up a new User-Defined Variable- gaProperty & gaDomain.
Click Variables then click on a +New button. Enter a new Constant called gaProperty and add your GA tracking ID and save the settings. Next, add the gaDomain with a value of auto and save settings. Publish this workspace as change Version 2 by clicking Submit.
Cross Domain Tracking
Cross Domain Tracking in Google Tag Manager permits session data between the two domains to be viewed as one in Universal Analytics.
Under Tag Configuration select More Setting > Fields to Set > click Field Name and in the drop-down menu select allowLinker, and in the value field type True.
Scroll down in the More Settings to click the cross-domain section to expand the fields. After it expands you will see three fields
In the Auto link domains, you can add the domains here separated by a comma. Set the other two fields to False.
No sooner the link is clicked that leads to “abc.com,” Google Analytics will attach the link with information that permits the two sites to share the data between the domains in the same analytics account. The linker parameter will look like something given below.
Navigate to your Google Analytics Admin settings. Under property settings click on the .js Tracking info and from the drop-down select Referral Exclusion List. Add the domains your visitors will travel over to your website.
- dataLayer = [ ] ;
For adding a data layer the object placement has to be before the Google Tag Manager container code. After the addition of the data layer code in the page code, the bracket contains variables, events, and information. You may write information directly into the data layer or insert it dynamically.
Digital Marketing Solutions
Thank you for subscribing.
Something went wrong.