Tracking e-commerce transactions with Google Analytics

If you're building your first e-commerce store, you might think that getting a lot of traffic to your site is always good. While traffic is usually good, it helps if you can figure out whether your traffic is actually buying. When you send e-commerce data to Google Analytics, you can figure out exactly which traffic is buying. You could see that users from Facebook typically spend $5–10 whereas users who come from your newsletter spend $50–100. Now that you have the numbers, you can make more informed decisions.

This is one of the steps that I recommend for every single e-commerce store. Even if you don't plan on using the data, it will only take a few minutes to set up. Moreover, if you decide you want to use the data down the line, you will have a huge backlog of data.

Getting ready

You should already have a free Google Analytics account set up for your website. You should also be using a plugin to send your non-e-commerce traffic data to Google Analytics. A good plugin to do that is Google Analytics by Yoast.

How to do it…

The ability to track Google Analytics data used to be included in WooCommerce, until WooCommerce 2.1. At that point, the functionality was put into a free plugin for the ease of updating both WooCommerce and the Google Analytics Integration plugin. We need to install that plugin and then configure a few settings.

  1. In the WordPress admin, click on the Plugins menu and then click on Add New.
  2. Look for the WooCommerce Google Analytics Integration plugin.
  3. Install and activate the plugin.

    There is one setting we need to configure in your Google Analytics account. You need to enable E-Commerce tracking. It should take a few clicks to enable the setting. You can follow their official instructions at https://support.google.com/analytics/answer/1009612?hl=en.

    Alright, we've got the plugin installed—your Google Analytics account is configured and ready. We just need to check a few boxes to send the right data to Google Analytics.

  4. From the WordPress admin, go to WooCommerce | Settings | Integration.

    If this is the only integration you've added, then Google Analytics Integration will pop up. If you've added multiple integrations, you'll have to click on Google Analytics.

  5. Fill out your Google Analytics ID. You can find your Google Analytics ID in Google Analytics under your list of sites, as shown in the following screenshot:
    How to do it…
  6. Make sure you leave Add tracking code to your site unchecked.

    Note

    You could use this plugin for all Google Analytics tracking, but other plugins have more options. I always advise people to use a separate plugin like Google Analytics by Yoast for tracking non-e-commerce data.

  7. It's advisable to use the new Universal Analytics features rather than the classic features. If you have an older Google Analytics account, you'll have to first convert your account to a Universal account and then check the Use Universal Analytics setting instead of Classic Google Analytics setting. If you created an account mid-2014 or later, it should already use Universal Analytics.
  8. Check the Add eCommerce tracking code to the thankyou page setting.
  9. Click on Save changes.

There's more…

With Universal Analytics, there's a new feature called Enhanced E-Commerce, which gives you more data you can use. This feature is on the roadmap for the Google Analytics plugin and should be completed in early 2015. Once that feature is available, you should absolutely use it to track as much data as possible.

There is a WooCommerce Google Analytics Pro plugin, which is currently in development. It does the same thing but uses advanced server-side tracking to send the data to Google Analytics. This can be useful for getting more accurate data. From what was heard of the reports at the time of this writing, this plugin should be released by mid-2015.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset