Implement Enhanced eCommerce Tracking in Google Analytics

Created by Ezra Weinstein, Modified on Mon, 26 Feb 2024 at 03:52 PM by Jeff Cummins

Update October 2023: coreFORCE supports Google Analytics 4. The following events are supported:

  1. Search
  2. view_item 
  3. add_to_cart 
  4. remove_from_cart 
  5. add_to_wishlist 
  6. begin_checkout 
  7. purchase

The instructions below are not up to date for GA4, though the general gist of the steps is similar. See this page from Google for GA4-specific instructions


coreFORCE enterprise supports the analytics data requirements of Google enhanced eCommerce tracking, but there are several steps required on Google's site to set it up. To implement enhanced eCommerce, do the following:

 

1. Sign up for Google Analytics

 

If you do not already have a Google Analytics account, sign up for that first at https://analytics.google.com. You will be required to sign in with a Google account and identify the website you want to use with Analytics. There is an introduction from Google here: https://support.google.com/analytics/answer/1008015?hl=en

 

Do not use the Google Analytics tracking tag. For enhanced eCommerce, you will need to use the Google Tag Manager tracking tag.

 

2. Sign up for Google Tag Manager

 

For tracking website visits and demographics, Google Analytics is sufficient, but in order to use enhanced eCommerce, you also need to sign up for Google Tag Manager (GTM). GTM is a separate product that integrates with Google Analytics and replaces the Analytics tracking tag with a much more flexible tagging system.  Sign up for GTM at https://marketingplatform.google.com/about/tag-manager/

 

There is an introduction from Google here: https://support.google.com/tagmanager/answer/6103696?hl=en

 

3. Link Google Analytics to Tag Manager

 

Follow these steps from Google to create an Analytics tag in GTM that will link your analytics account with your tag manager account:  https://support.google.com/tagmanager/answer/6107124?hl=en

 

You will create a tag called Analytics in GTM and enter your Google Analytics Tracking ID (starting with UA-...) in the configuration.

 

 

Publish your changes to Google Tag Manager by clicking on the Overview tab, clicking Submit in the upper right corner, and then clicking Publish.

 

 

4. Add the GTM tracking tag to coreFORCE

 

Once you have signed up for Google Tag Manager and connected it to your Google Analytics instance, you will need to add the tracking tag to coreFORCE. In GTM, there will be an identifier starting with GTM- in the header section.  Click on that to open a popup that contains the javascript tag manager code. It should look like the following screenshot. Click the copy button in the top code snippet to copy the code. Ignore the bottom snippet as it is not needed for coreFORCE.

 

 

In coreFORCE, click on Website > Templates > Analytics Code. If you do not already have an Analytics snippet created, click Add to create one. If you already have one created (e.g. for Zaius), you can edit it. Paste the GTM code into the Code box. It can coexist with other analytics platforms if you are already using one or more.

 

 

Save changes on the Analytics code. Then in Website > Templates > Templates, open the template for your site (typically it will begin with your business name). On the Javascript Tab, select the analytics code snippet you just created from the dropdown and save the template.

 

 

You can test the connection by visiting the front end of your coreFORCE site and then checking in Google Analytics to verify that your traffic is being tracked.

 

5. Add script to push the ecommerce purchase event to Google in the coreFORCE order response fragment

 

October 2023: this step is no longer required.  coreFORCE handles the purchase event without any need to customize the order response fragment.  
NOTE: if your site currently references  "orderData " in the Javascript of the fragment, the default purchase event will NOT fire.  To use the built-in purchase event, remove any reference to orderData from the fragment.  
IMPORTANT: it is NOT sufficient to comment this code out.  It needs to be removed completely. The reason is that the backend code is doing a text search for the string "orderData" in the fragment.

 

6. Turn on enhanced eCommerce in Google Analytics

 

In Google Analytics, you will need to enable enhanced eCommerce for your site. Click on Admin (next to the gear icon in the lower left corner), and then find eCommerce Settings in the right column.

 

 

In eCommerce settings, make sure Enable Ecommerce and Enable Enhanced Ecommerce Reporting are turned on.

 

 

7. Create enhanced eCommerce tags in Google Tag Manager

 

The last step to enable enhanced eCommerce tracking from coreFORCE is to create Tags and Triggers in GTM that will listen for the events that coreFORCE will send. There are 5 triggers and 5 events. They are all set up exactly the same except for the name of the custom event. The event names are these:


  1. search - triggered when searching for a product
  2. view_item - triggered when clicking on product details
  3. add_to_cart - triggered when adding a product to the cart (or changing quantity)
  4. remove_from_cart - triggered when removing a product to the cart (or changing quantity)
  5. add_to_wishlist - triggered when adding a product to the wishlist
  6. begin_checkout - triggered when clicking the start checkout button in the shopping cart page
  7. purchase - triggered when an order is placed

 

The following will walkthrough the process to create the search event.*  These steps should be repeated for each of the 5 events.

 

A. In Google Tag Manager, click on Triggers, and then click New in the upper right.

 

 

B. Give the Trigger a name, and then click on "Choose a trigger Type to begin setup". In the trigger type pane that opens, click Custom Event.

 

 

C. Enter the event name as search, and select "This trigger fires on all custom events".

 

D. Click on Tags in the left side bar and click New.

 

 

E. Give the Tag a name, click on "Choose a Tag Type to begin setup" and then click on "Google Analytics: Universal Analytics" in the Tag Type pane.

 

 

F. Enter the following settings in the Tag Configuration.

 

  • Track Type: Event
  • Category: type {{Event}}
  • Action: type {{Event}}
  • Enable overriding settings in this tag
  • Tracking ID: enter your Google Analytics tracking ID
  • Under More Settings, in Enable Enhanced ecommerce Settings, select True
  • Check Use Data Layer

 

G. Click on Choose a Trigger to Make this tag fire, and select the Detail trigger that you just created.

 

H. Click Save to complete the tag configuration.

 

I. Repeat the previous steps for each of the 5 ecommerce events listed above.

 

8. Publish changes in Google Tag Manager

 

Once you have completed all of your trigger and tag setup, in the Overview tab in Google Tag Manager, click on the Submit button in the upper right corner, and then click Publish, as you did in step 3 above. This will make your changes live.

 

Once all of these steps are completed, you will begin to see ecommerce metrics reflected in Google Analytics as customers shop on your site. This information will appear under Conversions > Ecommerce.

 


*Note that in a previous version of the coreFORCE Google Analytics integration, the event names were all prefixed with "eec", such as "eec.detail", "eec.add", etc.  With the update to GA4, this naming convention has been abandoned in favor of the standard event names that Google uses.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article