Tracking Drupal Commerce orders with Google Analytics

By Sil, 02/14/2013 - 15:12
Drupal Commerce Google Analytics

Knowing what your customers are doing before spending money in your Drupal Commerce store can be valuable information for your business. It could help you create the shopping experience that meets the needs of your customers. With Google Analytics you can collect valuable visitor behavior information. Drupal Commerce is where the actual sale happens. In this tutorial I will learn you how to put those two together. It enables you to integrate Drupal Commerce order information with Google Analytics.

Google Analytics data from Drupal Commerce sales

Configure the Google Analytics profile

First enable ecommerce tracking in your site's Google Analytics Profile. Learn how to do that in this Google Analytics tutorial on enabling ecommerce tracking. And while you're at it, make sure it reflects the right currency amount in that profile. 

Configure Google Analytics Module

Download and enable Google Analytics module. To allow Drupal Commerce order tracking you should at least enter the Google Analytics UA id at example.com/admin/config/system/googleanalytics. If you want to do more advanced things like for example 'user segmentation' or 'internal site search' tracking, have a look at this tutorial about configuring Google Analytics module.

Configure Commerce Google Analytics Module

Download and enable Commerce Google Analytics module. No configuration required. Yes, module maintainers rock. They are making this even cooler: Rules integration is currently in development. 

Configure Drupal Commerce product Titles and SKU's

Make sure your Drupal Commerce product titles and Stock Keeping Units make sense as they will be used in reporting. Note that Commerce product titles are a different thing than the titles of your product display nodes. If you're using Commerce Kickstart, have a look at this tutorial on how to change the product titles.

Test ordering Drupal Commerce products

Always be testing: place a few orders in your store, and check if they show up in your Google Analytics profile. Make sure you set the Google Analytics date range to include today - by default it doesn't include today. And make sure the order amounts, product prices, tax amounts and shipping cost are correctly tracked.

Testing orders without paying

When testing your ecommerce order analytics you don't want to actually pay for the order with money. Have a look at the tutorial about configuring a 'no payment' payment method with Payment module to be able to pay without really paying for it.

Tracking Email Metrics with Drupal Commerce

If you're interested in tracking eCommerce metrics regarding email campaigns, have a look at my tutorial about tracking MailChimp campaign Metrics with Drupal Commerce and Google Analytics.