One of the most challenging aspects of digital marketing & client management is proving value. What better way to prove value than to show exact revenue dollars from marketing efforts? There's also enhanced eCommerce which shows conversion funnel details, but standard eCommerce provides great insights & is easy to set up using WooCommerce. Another perk is there's no web development or coding experience necessary.
HOW IT WORKS
Regardless of which CMS you use, this is how eCommerce tracking via Tag Manager works. WooCommerce just makes it easy, but these are the fundamental components.
WHAT YOU'LL NEED
Make sure you have everything you need before we get into the nitty-gritty.
STEP 1: GATHER THE DATA
Setting up the Data Layer collects the data & makes it readable.
Download the Google Tag Manager for WordPress plugin. Log in to the WordPress dashboard and select "plugins" and "add new." Then click, "upload plugin" and upload the zip file which you downloaded from the above link.
Step 1.2: Configure the Plugin
Once you've got the plugin installed, navigate to "settings" and there should be a new option for "Google Tag Manager."Once you're there, you'll see a spot for "Google TagManager ID" where you input your ID (GTM-XXXXX).
Note - I have the container code placement set to "off" since I already have GTM placed on the site placed directly into the header.php file. Having duplicate tags on your site may cause errors in traffic.
At this point you have the plugin creating the data layer when a user completes a checkout. You can even run a test checkout and view the source code of a checkout page to see if the parameters are coming through.
This plugin data-layer setup is the only piece that is unique to WooCommerce. You can use the following steps to configure eCommerce tracking using GTM & GA on any site. You can have a developer create a data layer using these parameters.
STEP 2: CONFIGURE GTM TO READ THE DATA
Now we set up GTM to read the data from the data layer.
Step 2.1: Make Sure You Have GTM Implemented Correctly
You can either implement GTM using the plugin we installed, or have it implemented working with a web developer following these instructions. Then you can use the Tag Assistant chrome extension to make sure it's working correctly.
Step 2.2: Set Up the Tag
On the "Tags" page, click the big red button for "New" to add a new tag. Then click the pencil icon in the "Tag Configuration" section, and select "Google Analytics - Universal Analytics.
Once you've selected that, you'll have a list of options. Make sure you select "Transaction" for "Track Type".
Under "Google Analytics Settings" pick "New Variable"- then input your tracking ID in this section (UA-XXXX) and go ahead and save the variable. Your finalized settings will look something
Step 2.3: Set Up the Trigger
Click the pencil in the top-right corner of the "Triggering" section. Then on the "choose a trigger" page, click the little blue plus sign "+" in the top-right.
You can name your even whatever you like, but I like to keep the naming consistent with the event name in Analytics. In this case, the plugin will create an event named "gtm4wp.orderCompleted". This is what your finalized event trigger will look like:
Once you've completed this tag & trigger, make sure to save and publish your changes.
STEP 3: CONFIGURE ANALYTICS TO SHOW THE DATA
The last & easiest step is just flipping a couple of switches in Analytics.
Step 3.1: Make Sure Analytics is Working on Your Site
You can implement the Analytics tag via GTM or hard-coded, but make sure it's not on the site twice. Also, use the plugin mentioned in step 2.1 to make sure the Analytics tag is working.
Step 3.2: Set Up Ecommerce in Analytics
Once you're logged in to Analytics, select the "Admin" option on the left navigation. Then select "Ecommerce Settings" from the column under "View". Flip the switch for Ecommerce and then hit "Save" at the bottom.
LAST STEP: TESTING
It was pretty easy, but let's make sure it works.
As long as you're seeing this data layer information in GTM, and you've saved & published everything, this information should be sent to Analytics. At this point, you can go to Analytics and navigate to "Conversions" and "Ecommerce".
You should be able to see your test transaction here, just make sure your date view is "Today". Also note that sometimes it takes a couple of hours to see transactions in Analytics.
Comment below or send me a message with any questions!