We recently had to implement Webgains tracking for a client, we were using Google Tag Manager and Enhanced Ecommerce Google Analytics. Simple we thought, as all the data required for order tracking is in the data-layer for GA EE, however it was not straight forward and there was a real lack of information online, so having found the solution we wanted to share it.
Implementing Webgains requires creating a product feed and implementing order tracking, this guide focuses on the order tracking. We focus on Magento, however this guide will work on any platform. If you use Magento we recommend Data Feed Manager from WYOMIND to create product feeds
So first there are some requirements, this guide assumes the following:
- Have implemented the Enhanced Ecommerce data-layer for Google Analytics
- Use Google Tag Manager with 3 variables setup:
- Order ID set-up as a variable called "ee transaction id"
- Order Revenue set-up as a variable called "ee transaction revenue"
- Products ordered set-up as a variable called "ee transaction products array"
How to implement webgains order tracking in GTM
- Setup the first variable, a constant, name it "wgEventID", the value will be provided by Webgains
- Setup the second variable, a constant, name it "wgProgramID", the value will be provided by Webgains
- Set-up the trigger, its vital that your trigger is set to Page View - Window Loaded and only fires on your order confirmation or success page, for Magento (1 & 2) the URL is /checkout/onepage/success/
- Set-up the tag, a custom HTML tag, this is the tracking script you'll receive from Webgains (ask for the non open tag version)