Setup

Sana Commerce 9.3
Your connector

Google Tag Manager



Here are some possibilities and advantages which Google Tag Manager (GTM) provides to improve your online business management: 
  • You can add and update Google AdWords tags, Analytics tags, DoubleClick Floodlight tags and many non-Google third-party tags directly from Google Tag Manager, instead of editing the website code.
  • Google Tag Manager allows you to install a basic implementation of Google Analytics via Google Tag Manager.
  • GTM is equipped with Auto-Event Tracking functionality. You can create event tags directly within the Google Tag Manager interface and fire them with triggers. It will help to track and understand customers' actions.
  • Its built-in debug features allow to test and debug each update on your site prior to publication, ensuring that your tags work properly before they are live.

To start your work with Google Tag Manager you will need to do the following:

  • Create Google Tag Manager Account (this account will be used for Google Analytics as well).
  • Set up container and enter the container ID into Sana Admin.
  • Configure Google Tag Manager for your webstore.

For more information about Google Tag Manager usage and its basic configuration, see "Google Tag Manager Help".

Google Tag Manager provides a lot of great tools. In this article we give you one of the common scenarios of how to set up Google Tag Manager with Google Analytics for the Sana webstore. For more information about Google Tag Manager features and tools, and how to set up them, refer to the official Google documentation.

How to set up Google Tag Manager for the Sana webstore?

Step 1: Create Google Tag Manager account. Enter the account name and then click Continue.

Step 2: Set up Google Tag Manager container. Enter the container name and select the "Web" type of content. Click "Create".

When the container is created, you will see the container ID in the following format GTM-XXXXXXX. It is automatically generated by GTM. For more information, see "Setup and installation".

Step 3: Copy the container ID. In Sana Admin click: Setup > Marketing > Analytics. Enter the container ID in the "Google Tag Manager Container ID" field.

Set up Google Analytics via Google Tag Manager

Google Tag Manager integrated with Google Analytics reduces errors, allows to quickly deploy tags on your webstore and thus makes the tracking procedure easier.

Google Analytics is a free analytics tool that enables you to gather all kind of information and generate reports that will help you with your marketing.

Integrating your webstore with Google Analytics is a simple process that will give you access to the detailed statistics of the traffic in your webstore, like page views, webstore visitors, transactions, users interactions with your webstore content, and their shopping behavior.

To start using Google Analytics:

Step 1: In Goggle Tag Manager, select your account.

Step 2: Create a new tag. You can do this either from the workspace or from the navigation menu on the left.

Step 3: Enter the tag name and choose the "Universal Analytics" tag type.

Step 4: Select the Track Type.

For basic Google Analytics tracking, add a single Google Analytics tag and select Page View as the track type. Add a trigger to fire the tag on all pages. If basic tracking is all you need, you'll just add this single Google Analytics tag. However, if you track events or ecommerce transactions, you'll need to add additional Google Analytics tags.

The most suitable track type for ecommerce tracking is Event tracking, which is used to track a specific action or event, such as a button click. Below you can see the list of events that are supported by the Sana webstore and which you can set up in Google Tag Manager.

Step 5: When the Event track type is used, enter Category name and Action. The category name can be anything that reflects the action you want to track. The Action value is used to name the type of event or interaction you want to track for a particular web object.

The table below provides the list of actions which can be tracked on the Sana webstore.

Action Description
impression Triggers on the product list and search results pages, and when the last viewed products are shown. Measured when the page loads and is sent with the initial page view.
detail A view of products details.
productClick A click on a product or product link for one or more products.
addToCart Adding one or more products to a shopping cart.
removeFromCart Remove one or more products from a shopping cart.
checkout Initiating the checkout process for one or more products.
checkoutOption Sending the option value for a given checkout step.
purchase The sale of one or more products.

Step 6: In the "Google Analytics Settings" field, select the existing or create a new Google Analytics Settings Variable. It contains your Google Analytics Tracking ID. All settings from that variable will be applied to your tag.

Google Analytics Settings Variables enable you to easily reuse and maintain settings across tags. If necessary, you can configure settings for a certain tag independently by selecting the checkbox "Enable overriding settings in this tag". If you don't select a Settings Variable, you must set your Tracking ID via the override settings.

When you create a new Google Analytics Settings Variable, go to: More Settings > Ecommerce. Enable the options "Enhanced Ecommerce Features" and "Use data layer".

 NOTE

Enabling ecommerce features is important to track ecommerce-related interactions. This will allow to see when customers have added the products to the shopping cart, when they have started the checkout process, and when they have completed a purchase.

If you do not see any ecommerce data in your Google Analytics account, you could try an alternative solution for step 6. In that case, we recommend keeping the Google Analytics Settings variable empty, select the checkbox "Enable overriding settings in this tag", and add your Google Analytics Tracking ID. Please, don't forget to enable also the Enhanced Ecommerce Features and Use data layer under the Advanced Settings menu item.

For more information, see "Deploying Google Analytics".


 NOTE

Please, note that Google Analytics accepts only integers as the product quantity for sales orders. If your webstore also supports decimal quantities for products (e.g. customers can order 0.5 piece of a product), these numbers will be rounded to the closest integer and sent to Google Analytics. Example: 0.5 piece will be sent to Google Analytics as 1 piece.

At the moment there is an issue that 0.5 piece of a product is rounded to 0 and such products are not shown in the sales order transactions in Google Analytics. But all other data of the sales transactions, like revenue, is calculated correctly in Google Analytics. The issue with rounding 0.5 piece of a product to 0 will be fixed in the next Sana release.


Step 7: Choose your firing triggers. The best trigger for event tracking is "Custom Event" with the expected event name, but you can select other triggers suitable for your scenario.

To add the "Custom Event" trigger, create a new trigger of the "Custom Event" trigger type.

Enter the title of the trigger and Event name. The event name should be the same as the name of the action.

For more information about tag firing, see "Triggers".

Step 8: Save the tag.

This way you can create all the necessary tags and triggers. When you are ready, you can preview and debug the container, and publish your changes.

When Google Tag Manager is configured with Google Analytics, you can check the shopping and purchasing behavior of your webstore visitors and customers. Each time when a user performs some action in the webstore, like views the product details or adds a product to the shopping cart, a certain event is triggered, and the information about this action is sent to and tracked by Google Analytics. The shopping analysis reports give you insight into the shopping activities, like product and product list views, adding and removing products from shopping carts, initiated, abandoned, and completed transactions.