Drupal eCommerce & Google Analytics - How to Set Up Purchase Conversion Goals

Posted in by

To get the most out of Google Analytics in a Drupal Commerce site, start tracking each sale as a conversion in Google Analytics.

We've created a guide to help get you on track to tracking conversions in Google Analytics. Follow these instructions and you'll gain new insight into how well your website converts visitors in to sales and what traffic sources tend to convert the best. The first five steps are simple, and the next six steps are a little more involved.

Let's log into our Google Analytics account to get started:

Navigate To Goal Setup

Click "Admin" In The Header

This will take you to your Administration Dashboard where you can adjust settings at an Account, Property or View level:

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 1

Under The View Column, Click "Goals"

This will bring up all goals related to a view:

​​Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 2

Click "+ New Goal"

Now you're ready to start creating your new Analytics Goal:

​​Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 3

Goal Setup

Select a Template or Custom Goal 

If you want to use a template goal under "Revenue", select "Buy Merchandise." This is a destination URL goal that will trigger a conversion after a specific page is viewed.

Or, you can select a custom goal if you'd prefer and set the type as "Destination." A "Destination" goal is triggered when a certain page is viewed. A good example of a "Destination" page for sites that are focused on converting visitors into leads is the "Thank You" page that a visitor sees after submitting a contact form.

Either route will work. For the sake of this example, we're using a template 'Revenue' goal:

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 4

Goal Description

Customize The Name of Your Goal

We often use the name "Customer Order", "Purchase" or "Completed Transaction". You can leave the Goal slot ID and the type to the default options:

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 5

Goal Details

Input Your Goal Details

This includes your Destination URL, Conversion Value, Funnel Tracking, Verifying the Goal and finally creating the goal once you've verified that its working. We'll go through each one in more detail below.

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6

Selecting Goal Details - Use "Regular expression"

You want to select "Regular expression" from the drop down for the destination URL because you want to enable flexible matching, since the URL is likely to be slightly different from one transaction to the next.

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6a

Your Goal URL Should Look Like This:

'checkout/[0-9]+/complete'

(you can leave the "case sensitive" box unchecked)

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6b

Tracking Value

If you have an average order size or a single order amount, you can turn on "Value". Then going forward when a goal is triggered it will tie the value you assigned to orders and show you an aggregate value of all the orders that were tracked in Google Analytics. In our screenshot we used an average conversion value of $50:

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6c

Funnel Tracking

If you want to see where you are losing people in the checkout process, you can turn on "Funnel". Then you'll also need to add the following "steps"/URLs involved in your checkout process (yours might vary slightly)

  • /cart
  • /checkout/[0-9]+
  • /checkout/[0-9]+/shipping
  • /checkout/[0-9]+/review

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6d

Verify & Create This Goal

Click "Verify this Goal" to see how it would have converted based on data from the past seven days. Then click "Create Goal" and you're done for now. I would recommend checking in on this goal closely for the 2-3 days to make sure it is recording data and then after check on it weekly for the first three weeks to make sure the goal is firing when people land on your order complete page.

Creating a Conversion Goal in Google Analytics for Drupal Commerce - Step 6e

Hope you found this helpful, and if you have any thoughts or questions, we'd love to hear from you in the comments.

About the Author

Marty Vernon

Marty is Co-founder/Strategic Director at EDUCO. Connect with Marty on , , or Google+