Setting up Google analytics for Ecommerce tracking

Efficient tracking plays an important role in the success of any Ecommerce store. Infact, today marketers want to know every little activity happening in their store. They can leverage this data for boosting sales to multiple folds. The Overall tracking process can be split up into 3 major tasks Data Collection, Data Reporting and Data Analysis. In this article, we will be covering the first part, that will guide you the right way of setting up Google Analytics for Ecommerce tracking.

Note: Since, shopify is the most widely used Ecommerce platform for online stores, so in this guide, we will take it as an example to make things easier to understand. However, the same setting can be used with other Ecommerce platforms as well, with few changes.

Let’s start this guide with basic understanding of Google Analytics Account Structure.

word image 127

So, you can have multiple Properties (website, app etc) under an account. Now, each property is identified by a unique tracking ID. Under each Property, you can create multiple views. Basically, a view is your access point for reports. For ease of reporting, you can create different views for different purposes.

Creating Views in Google Analytics

A smart thing to do is to have at least five views:

  • Raw Website Data – This will be your untouched data and it will serve you only as a backup because once you have applied changes to how the data is processed, it cannot be undone in GA. There should be no filters, IP exclusions, goals, or anything else in this view.
word image 128

Step 1: Go to admin setting

Step 2: Under “View” column, select “Create View”

  • Master View – This is actual view that you will be using more often
  • Test View – This where you can try out filters and do experiments before applying to them other views
  • Desktop Traffic view – To filter out traffic coming from Desktop
  • Mobile Traffic view – To filter out traffic coming from Mobile phones

Syncing Time and Currency with your Store

In order to ensure accuracy in reports, it is essential that you must sync time zone and currency settings in both your store platform as well as Google Analytics.

Step 1: Go to admin setting

Step 2: Under “View” column, select “view settings”

word image 129
word image 130

Create and apply filters

Google Analytics gives you the freedom to apply different filters to segment data into smaller groups, exclude unwanted data, or search certain pieces of information. Filters can be created at the Account or View level.

Step 1: Go to admin setting

Step 2: Under “View” column, select filters

Step 3: Add new filter

word image 131

Some other interesting things that you can do using filters are,

  • View only (or exclude) data from mobile traffic
  • View only (or exclude) data from a particular domain
  • View only (or exclude) data from a particular location

word image 132

If you have a big team who constantly visits the store, you can filter IP addresses of all your team members, so as to achieve more accuracy in reports.

Go to: Filters > click “Predefined” > Choose filter type “Exclude” > add your IP address > Click “Save”

word image 133

Exclude bots and spam from analytics reports

Nobody wants to see Fake traffic in their Analytic reports. There are lots of programs and bots on the web which can result in fake visits on your website. Thankfully, google Analytics has provided a way to filter them out from your reports. Applying this filter allows Google to block some spammers. It won’t solve all of your problems, but should mostly get the job done.

Step 1: Select “View Setting” from the Admin tab

Step 2: Check the box marked “Exclude all hits from known bots and spiders.

google analytics ecommerce tracking

Get Site Search Reports

These days almost all the Ecommerce stores have got a search box, where visitors can find the products as per their choice. This saves a lot of time for the users and enhances the overall navigation. Consider a big store like Amazon, having thousands of products. It is very seldom that you will find the products using product categories. So, these search queries help in understanding user’s behavior. It helps you in tracking what people are searching for on your site, and whether or not they’re finding it. Google Analytics provides a way to activate site search reports.

Shopify users are able to configure Site Search reports using a query parameter.

Just do a random search on your store and look at your URL. It should look similar to one of these three options:

https://www.example.com/search?q=shirts

https://www.example.com/search.php?id=search&term=shirts

https://www.example.com/search.asp?search_query=shirts&id=ac9765

In the first example, we can see ‘q’ is the query parameter because it’s between the question mark and the equals sign.

If your URL looks entirely different, then you will have to use another method for configuring Site Search reports.

word image 134

Step 1: Go to Admin section

Step 2: Select the desired view and click on the ‘View Settings’ option.

Step 3: Go to the ‘Site Search Settings’ area and switch it on.

Step 4: Enter query parameter used for search queries in the Query parameter box. You’ll find this variable in the URL you identified while performing a search on your site. Since I am using Shopify, so I am entering “q” as a parameter.

Step 5: Check ‘Strip query parameters out of URL’ This will prevent your search from showing up in your content reports.

Step 6: Repeat this process on other views, if required.

Enable Google Signals

In 2019, we got access to remarketing and advertising reporting features in Google Analytics. Advertising Features have been upgraded to Google signals. When Google signals is enabled, you gather cross-device data, demographic data, and additional information about users for advertising as well as enabling remarketing with Google Ads.

Step 1: Go to Admin Section > Tracking Info > Data Collection.

Step 2: Follow the prompts to enable the feature.

word image 135
word image 136
word image 137

Checkout Behavior Report

If you are aiming for conversion rate optimisation then this feature is for you. The Checkout Behavior report can be found in the Conversions section of Google Analytics. Using the easy segmentation in this report, you will see each stage of the checkout process for people in different countries, browser, traffic source, and more.

Step 1: Go to the “Admin” section

Step 2: Select your filtered view then click “Ecommerce Settings”

Step 3: Enter three funnel steps as “Contact Information”, “Shipping Method”, and “Payment Method”. The same labels will be used in the Checkout Behavior report.

word image 138

Step 4: In Shopify admin, go to “Online Store” then “Preferences”. In the “Additional Google Analytics JavaScript” section, paste the following code:

<!-- wp:paragraph -->
<p>
  // Checkout steps for the Checkout Behavior report in Google Analytics
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
  var ShopifyCheckoutstep = Shopify.Checkout.step;
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
  switch (ShopifyCheckoutstep) {
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
    case "contact_information":
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("require", "ec");
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("ec:setAction", "checkout", {
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "step": 1,
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "option": "contact_information"
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga('send', 'event', 'checkout', 'contact information', { nonInteraction: true });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        break; 
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
    case "shipping_method":
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("require", "ec");
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("ec:setAction", "checkout", {
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "step": 2,
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "option": "shipping_method"
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga('send', 'event', 'checkout', 'shipping method', { nonInteraction: true });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        break; 
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
    case "payment_method":
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("require", "ec");
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga("ec:setAction", "checkout", {
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "step": 3,
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
        "option": "payment_method"
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
      ga('send', 'event', 'checkout', 'payment', { nonInteraction: true });
</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>
  };
</p>
<!-- /wp:paragraph -->
word image 139

When data collects, your Checkout Behavior report will look like this:

word image 140

Use Enhanced Link Attribution

This feature helps in understanding how people interact with a page. You can visually see on which links people click most. Using this data, you can also perform split-tests.

Step 1: In Shopify go to “Online Store” > “Preferences”

Step 2: Copy-and-paste the following line of code into the “Additional Google Analytics

JavaScript” field of Shopify then save the page:

ga(‘require’, ‘linkid’);

Shopify analytics configuration

Step 3: Go to Admin section of your Google Analytics account

Step 4: Go to “Property Settings”.

Step 5: Turn on “Use enhanced link attribution” then save.

word image 141

Linking Search Console with Google Analytics

This integration lets you analyse things like,

  • What search terms make your store appear in Google?
  • How many clicks did you get last month from a specific search query?
  • How many clicks did you get last month from a specific search query?
  • How many positions did you move up for your main keywords?
word image 142
word image 143

Get Custom Alerts

While managing growing stores, it becomes difficult to check Google Analytics everyday. So, by using Google Custom Alerts, you can receive an email or SMS of major behavioral changes on your store.

Step 1. Go to “Customization” then “Custom Alerts”

Step 2: Click “Manage custom alerts” then click “+ New Alert”.

Lets try setting up a few alerts now.

Alert 1: No daily traffic

Learn when your site is down.

Period: Day
This applies to: All traffic
Alert me when: Sessions
Condition: is less than
Value: 1

word image 144

Alert 2: Revenue increase for new visitors

Learn when you get a nice boost in revenue from new visitors on the same day compared to the prior week.

Period: Day
This applies to: Visitor Type
Condition: Matches exactly
Value: New Visitor
Alert me when: Revenue
Condition: % increases by more than
Value: 20.0%
Compared to: Same day in the previous week

word image 145

Alert 3: Drop in performance of products

The alert notifies you when any of your products have a bounce rate greater than 50% for a week:

Period: Week
This applies to: Page
Condition: Contains
Value: /products/
Alert me when: Bounce Rate
Condition: % increase by more than
Value: 50%
Compared to: Same day in the Previous week

word image 146

Measure demographics and interests

Google Analytics can help you identify key information about your customers such as age, gender, tests, habits, hobbies, and more.

Step 1: Go to Property Setting from the Admin section

Step 2: Turn on Enable Demographics and Interest Reports.

google analytics ecommerce tracking

Installing Enhanced Ecommerce

This feature is easy to install, if you are using a CMS platform like Woocommerce, Shopify and Magento. They have got either in-built functions or external plugins to enable it anytime. For other customised platforms, you will need the help of a web developer.

word image 147
word image 148

Set up custom metrics and dimensions

By default, there are predefined dimensions and metrics in the enhanced Ecommerce. But, If you feel like anything is missing, then you can add it to Google Analytics knowledge by using custom dimensions and metrics.

Custom dimensions

For instance, for a fashion ecommerce store, it is a good idea to pass product sizing information to Google Analytics.

Step 1: Go to Admin Section

Step 2: Under Property column, click custom definitions followed by custom dimensions.

Step 3: Click +New Custom dimensions button and add a name

Step 4: Select the Scope, which in this case will be ‘Product.’

Step 5: Check the Active box to start collecting data and see the dimension in your reports.

Step 6: Finally, click Create.

word image 149

Custom metrics

Custom metrics also pass additional product-related information to Google Analytics. This can be helpful if you wish to calculate the real revenue you generate.

Step 1: Go to Admin Section

Step 2: Under Property column, click custom definitions followed by custom metrics.

Step 3: Click +New Custom Metric button and add a name

Step 4: Select the Scope, which in this case will be ‘Product.’

Step 5: To track profit margin, your Formatting Type should be set to Currency

Step 6: Leave the other two boxes blank and set to active.

Step 6: Finally, click Create.

word image 150

After you create custom dimensions or metrics, you must also modify your site’s tracking code. Again, this may need to be completed by a qualified web developer.

Creating Google Analytics goals

Broadly speaking, there are three types of goals.

  • Destination Goals: Destination goals allow you to track when visitors reach a particular page or set of pages on your website. Common examples include tracking when visitors reach “thank you,” “order completed,” or “add to cart” pages.
  • Engagement Goals: Engagement goals allow you to track on-site activity, such as the amount of time visitors spend on your site, how many pages they visit, and what actions they take.
  • Event Goals: Event goals allow you to track when visitors perform an action on your site, such as watching a video, sharing a post on social media, or clicking an ad.

Creating Goal 1: Placed an Order Goal

Step 1: Go to Admin Section

Step 2: In the View column, Choose “goals”

Step 3: Click to add a new goal

Step 4: Choose “Place an Order” from goal setup

Step 5: In the Goal description, choose “destination”

Step 6: In the Goal details, destination equals to “checkout/thank_you”

Step 7: Save this goal

word image 151
word image 152
word image 153
word image 154

Creating Goal 2: Add to Cart Goal

Step 1: Go to Admin Section

Step 2: In the View column, Choose “goals”

Step 3: Click to add a new goal

Step 4: Click to engagement > add to cart

Step 5: In the Goal description, choose “destination”

Step 6: In the Goal details, destination equals to “/cart”

Step 7: Save this goal

word image 155
word image 156
word image 157

Creating Goal 3: User Engagement Goal

To find the user engagement we will set up a goal for the users who viewed more than 3 pages in a single session.

Step 1: Go to Admin Section

Step 2: In the View column, Choose “goals”

Step 3: Click to add a new goal

Step 4: Choose “Custom” in the goal setup

Step 5: In the Goal description, choose “Pages/screens per session”

Step 6: In the Goal details, pages/screens per session greater than “3”

Step 7: Save this goal

word image 158
word image 159
word image 160

Setting Goal 4: Checkout complete Goal

Step 1: Go to Admin Section

Step 2: In the View column, Choose “Checkout Complete”

Step 3: Click to add a new goal

Step 4: Choose “Destination” in the goal setup

Step 5: In the Goal description, choose “Pages/screens per session”

Step 6: In the Goal details, destination equals to “checkout/thank_you”

Step 7: Create a funnel for better tracking this goal

Shopping Cart => /Cart

Customer Information => /Checkout/Contact_information

Shipping => Checkout/Shipping

Payment => Checkout/Payment

Step 8: Save this goal

word image 161
word image 162
word image 163

Setting up Referral Exclusion list in Google Analytics

We all know that an attribution model is the rule, or set of rules, that determines how credit for sales and conversions is assigned to touchpoints in conversion paths. Now, while analysing the reports, it is essential that the attribution for conversion must go to the right traffic source. In order to ensure this, Google Analytics has provided a feature called referral exclusion list, in which you can exclude sources like PayPal or any other payment gateway. For Shopify, you can also add the checkout.shopify.com to your referral exclusion list.One more thing, you must add your own store’s URL also in this list.

Admin Section > Property Column > Tracking info > Referral Exclusion List

word image 164

How to ensure that Ecommerce Tracking is working in your Google Analytics account?

Now, you have applied all the above strategies, the next step would be to check if Google Analytics for ECommerce Tracking is working perfectly for your website. The simplest way for this is to do a “test checkout”. You can either create a 100% discount coupon and a bogus gateway to perform this test transaction. Once you have done this, give it a few hours to load up in the analytics account. Now, when you will check your account, navigate to Conversion >> Ecommerce >> Overview and set the date range to include today. If you can find the transaction data for the product you purchased and all the goals are triggered at right times, then your ECommerce tracking is set up properly.