How to implement Google Analytics with GTM (Google Tag Manager)



Google Analytics implementation through a Google Tag Manager container


Google Analytics is the premier eCommerce analytics tool (free for site traffic of less than < 200K sessions a day). This tool is offered in two versions Classic Google Analytics and Universal Analytics.
Universal Analytics

Transition to Universal Analytics

As of April 2014 all new Google Analytics accounts have to utilize the Universal Analytics tracking code. Classic Google Analytics will be gradually phased out, with all current and future emphasis on the Universal Analytics tracking code. For now Classic Google Analytics will still function, collect data and track your web-traffic. The main difference between the two versions of Google Analytics is the tracking code, the javascript engine they use and increased data configurations through Universal Analytics. Universal Analytics shifts tracking focus to the Visitor, while Classic Google Analytics was Visit oriented. We refer to Google Analytics as GA and will focus on a clean implementation using the latest tracking code version: Universal Analytics.

Transition to Universal Analytics

Getting started

Navigate to www.google.com/analytics/ and select “Access Google Analytics” and sign in with your Gmail Account (use the same account you used to sign up for Google Tag Manager). There are two ways to get the Google Analytics Tracking Code. You will be prompted to either sign up for a new Google Analytics account (if you do not already have an existing GA account) or you will have to create a new Account or Property if you already have a GA account.

Signing up for a brand new Google Analytics account.

You will be prompted to sign up and create your Google Analytics account (since there was no GA account associated with your Gmail).


new Google Analytics account

Existing Google Analytics Account

If you already have a GA account you will have to create a new account or property. Sign in to:
www.google.com/analytics/ and select Admin


Existing Google Analytics Accoun

Setting up a New Account

Once you either sign-up or create a new account, you will be prompted to configure the account by providing website information. You will need to name this account. We are using “My eCommerce Business” as an example. It is best practices to have one account for your business, but you can have multiple Properties. You will then have to name the Property (website) for which you are configuring the tracking code. We are naming this property “eComm Widget Store” - it is best to give it a name that represents the site you plan to deploy on (in case you have several sites or businesses). Lastly, you have to provide the website URL. Make sure the Web Pages button is selected, enter your website address, in this case we are using the fictitious www.myecommwebsite.com domain.
Sctn3-d.png
My eCommerce Business

Google Account vs. Google Property

A Google Analytics Account is your access point for Analytics while a Google Analytics Property is a subset of data within an account. An account can have more than one property but we recommend one account per business. Imagine you own an eCommerce coffee bean company called “Java the Cup” You have an English website, a Spanish website and a mobile app. Your account would be “Java the Cup” and you would have 3 properties: the English website, the Spanish website and the mobile app.
Google Account vs. Google Property
Sctn3-cccc.png

Select Time & Industry

Additionally, you will have to select your time zone and the type of Industry in which your website should be classified.
Select Time & Industry

Permissions

Lastly you will need to provide data sharing permissions for your website and tracking code. It is recommended that you share data “With other Google products only” as this will be a requirement for optimizing data integration between Paid Search, SEO, and Google Analytics. The other options are up you regarding the level of data sharing you wish to participate in. Data sharing settings do not make a difference in the level of GA performance.



data sharing permissions for your website


“To know where you can find a thing is the chief part of learning.” - Proverb


Implement Tracking Code

You are now ready to launch your new GA Universal Analytics tracking code.
Implement Tracking Code

Accept Terms

Upon accepting Google’s Terms & Conditions you will move into the account administrator configuration panel, where you will gain access to your GA Universal Analytics tracking code.
Google’s Terms & Conditions

Choose Deployment Type

There are two ways of deploying GA tracking code on your website. You can deploy through Google Tag Manager or you will have to copy the code in it’s entirety and have IT paste it on every page of your website (note the confirmation page utilizes a specialized configuration of the code that tracks eCommerce performance).







We recommend implementation using Google Tag Manager for both speed and stability. Make sure to copy the Tracking ID. Log into GTM and navigate to the “Container Draft Overview.” Select “New” to create a tag for GA Universal Analytics.
Google Tag Manager for both speed and stability


Name the Tag

In the New Tag interface name the tag, give it a name that corresponds with the type of tag it is. In this case we are calling it “Google Analytics”. Next select the Tag Type.
Name the Tag GA eCommerce analytics

Google Tag Manager comes pre-configured with several types of popular tags. Select “Universal Analytics” (even though there is a choice for Classic GA - that is geared more towards existing Classic GA deployments that are just now adopting GTM).
Universal Analytics Tag Manger

Insert ID Code

At this point you will need to insert the c which you copied from the GA deployment interface.

GA Universal Analytics Tracking ID code

Enable Display Advertising Features


Next select “Enable Display Advertising Features” - this will give you access to a very robust and rich set of demographic data to accompany your web-analytics website traffic and eComm performance data. This data includes viewing Demographics and Interest data for your website visitors, the capability to create advanced segments based on the Demographics and Interest data, and the ability to create Remarketing campaigns for AdWords that are based on website behavior as well as demographics or interest segments. For Track Type select “Page View.”

Enable Display Advertising Features in GA

“Life is like riding a bicycle.
To keep your balance, you must keep moving.”- Albert Einstein


Additional Configurations

There are a few more additional configurations. Select “More settings” then the drop-down “Ecommerce Features” and check both “Enable Enhanced Ecommerce Features” as well as “Use data layer” to pass data between your site and Google Analytics through GTM. We will review data layers configuration and set-up, in the Omnichannel section of Volume 2.

Additional Configurations for eccoomerce

Firing Rules

Next you will need to select Firing Rules. GTM allows the site owner to select when and how tags fire or are activated (for example on Product Detail Pages - for remarketing, in the Cart for cart abandon emails, or the Confirmation Page for affiliate marketer commission reporting). GA Universal Analytics needs to fire on every page of the site. Click “+Add”.
GA Universal Analytics on every page of the site

This rule is already pre-loaded into GTM. Select “Choose from existing rules” then click on “All pages” this will ensure that analytics will track every page and click on the site, from the start of a session through to the confirmation page.

confirmation page GA ecommerce


Finalize

This concludes the Tag configuration. Click Save to finalize the Universal Analytics tag through GTM.

 Universal Analytics tag through GTM


Publish

Now that the Tag has been created it is time to deploy it. The current tag you just built for analytics through GTM is not live yet, hence not collecting data. You need to click on “Publish” to push the tag live.

push the GA tag live


Confirm

You will have to confirm that you are ready to publish the version of the container that has the configured Google Analytics tag. Click “Create Version and Publish”.

GTM Create Version and Publish


The Tag is Live

The tag is now live and ready to collect web-traffic data for your web site. The beauty of GTM is that you can push a tag live without having IT or a Developer push code onto the site, it is all piped through the Google Tag Manager implementation.

initial GTM tag for Google Analytics

If you decide to bypass GTM and deploy by pasting the code onto every page of your site, copy the code exactly as generated by Google and insert it into the Global Header, right before the closing </head> tag.

Please Note!

Regardless of which method you used to deploy GA Universal Analytics on your website, the eCommerce configuration is not yet completed.
The confirmation page utilizes its own specific code. The eCommerce code is not included in the standard analytics tracking code, because not all websites conduct eCommerce and because eComm has its own specific nuances and transactional data to capture.


“The hardest work begins in
dry dock.” - Sam Wineburg

Important things to know about Google Analytics:


  • Google Analytics can not track any data before it is configured. The day the tool is configured is when the data will start. This extends to setting up events, goals, or enabling other features.

  • eCommerce integration requires some important additional steps
  •  
  •  

  • Need help setting this up? We'll walk you through next steps for setting up your eCommerce analytics.


 

  •  
  •  
  •  
Clickvoyant Web Developer

Get our free Google Analytics eCommerce Roadmap to help understand your web traffic data and make data driven decisions on both site enhancements and marketing channel optimization.