Now that we have Google Tag Manager up and running we can decide to enable Google Analytics with Google Tag Manager.
 |
Hint
Remember, you should never have both Google Analytics enabled in AudienceView and Google Tag Manager tracking Google Analytics on the same AudienceView website using the same web property ID, doing so will double count all your pageviews and ecommerce values. The web property ID is the unique identifier for a property within Google Analytics. A property is typically a distinct website that is being tracked within Google Analytics. |
If you want to track Google Analytics through Google Tag Manager you must first turn off Google Analytics in AudienceView. Before you do that, you should consider the differences between our
Google Analytics implementation and using Google Tag Manager for implementing Google Analytics.
The Differences Between Classic Google Analytics and Universal Analytics
Pageviews
The AudienceView Google Analytics implementation tracks pageviews on every page of the online journey. If you create a Google Analytics pageview tag in Google Tag Manager the implementation will be identical.
Events
The AudienceView Google Analytics implementation creates a Google Analytics event for a number of clicks in the online journey. An event is also created when the visitor creates an order. This data is a little unstructured and you may find instances where the event you want to capture isn’t captured. For example, when a visitor clicks on '
Continue' on the best available seat selection page an event is created in Google Analytics with a category of ‘Best Available’ and an event action of ‘Clicked’. If you implement Google Analytics through Google Tag Manager none of these events will be captured for you. The benefit of Google Tag Manager is that you can decide what events you want to capture and how you want to capture them. Take a look at
Use Case 3 – Sending Errors as Google Analytics Events for an example.
Customer Variables
The AudienceView Google Analytics implementation creates a visitor level custom variable when an order is created. Custom variable 1 is set to a category of 'Has Purchased' with a value of Yes. This custom variable is easily reproducible with Google Tag Manager if you want to maintain it.
Implementation
The video below demonstrates the steps required to complete this use case. Please watch the video in conjunction with the documentation.
To enable Google Analytics in Google Tag Manager we need to create two tags:
- A tag to track pageviews that is fired on every page.
- A tag to track ecommerce transactions that is fired when an order is completed
When an order is completed in the AudienceView online the visitor is navigated to a confirmation page that has the URL of viewOrder.asp. This page is also used when a visitor choose the option through their account to view a previous order. Fortunately we can differentiate between these two flows with the dataLayer. If a visitor creates an order we create an event in the dataLayer called
av.event.order-created. If the visitor views a previous order we create an event called
av.event.order-loaded.
Required Variables
You do not need to create any variables to provide data to Google Analytics. Pageview data is just grabbed by Google, all the ecommerce transaction data is provided in the dataLayer and the tag knows where to look for it.
Required Trigger
You will want to fire a page view tag on every page. Your Google Tag Manager container will already contain a trigger for this purpose called ‘All Pages’.
The ecommerce transaction tag needs to be fired only when an order is created. If you haven’t already created a trigger for this then go ahead now and create a trigger with a condition of
{{event}} equals av.event.order-created.
Configuring the Tag — Tracking pageviews
- Create a new tag
- Choose the Google Analytics – Universal Analytics tag type
- Enter your 'Web Property ID'.
You get this from your Google Analytics account.
- Set the ' Track Type' to Page View.
- Add a 'Firing Trigger' and choose the pre-configured All Pages trigger.
- Save the tag.
- Preview your container.
- Navigate to your website in a new browser window.
- Use Google Tag Assistant to confirm that your Page View tag is firing on every page of your online.
- Use Google Analytics to confirm that your page view data is reporting.
Google Analytics is time delayed. It could be a few hours before you start to see data in your reports.
- Publish your container and make your tag live.
Configuring the Tag — Tracking Ecommerce Transactions
Remember, we need to fire this tag when a visitor completes an order. It doesn’t fire on every single page.
- Choose the option to create a new tag.
- Give the tag a name.
- Choose the Google Analytics – Universal Analytics tag type
- Enter your 'Web Property ID'.
You get this from your Google Analytics account.
- Set the 'Track Type' to Transaction.
- Add a 'Firing Trigger' and choose the trigger you created to fire on av.event.order-created.
- Save the tag.
- Preview and debug your container.
- In a new browser window navigate to your website.
- Use Google Tag Assistant to confirm that:
- the tag is firing only on order completion, and.
- the data contains the detail of the order.
- Use Google Analytics to confirm that your ecommerce data is reporting.
Google Analytics is time delayed. It could be a few hours before you start to see data in your reports.
Publish your container and make your tag live.
Summary
We created a tag to send page view information to Google Analytics. This tag was set to fire on all pages. We didn’t need to create any variables to provide this tag with any additional information; Google just grabs all of the information that it needs. We also created a tag to send ecommerce transaction information to Google Analytics. This tag only fires when an order is created. Again, we did not need to provide any additional information to this tag via a variable, the dataLayer contains all of the ecommerce transaction data and Google knows where to look for it.