Google Analytics Goals and Funnels

From Shopify Wiki

Jump to: navigation, search

Yes, it is possible — and easy — to define goals and funnels in your Google Analytics account for your Shopify website.

Contents

What's a Goal, what's a Funnel

A goal is typically a website page that provides you with climaxing joy when it is visited by your customers. For most, the ultimate goal page is the checkout Thank you page. When your customers land on that page, it means they've bought something from you. Another goal example would be the static Thank You page you've set for a newsletter subscription.

A funnel represents the path that you expect visitors to take on their way to 'converting' to your goal. A funnel is defined for a goal. Defining the pages for a funnel allows you to see how frequently visitors abandon goals, when they join in on the path to your goal, when they drop off the path, etc.

Requirements

  1. Have a Google account.
  2. Using that Google account, sign up to get a Google Analytics account.
  3. Add your Shopify site to your Google Analytics account.
  4. Set up Google Analytics to work with your Shopify site. Instructions for this can be found here.
  5. Patience is also required: once you've finished editing your Goal and its (optional) Funnel, you'll have wait 24 hours before you see any data collected.

You have to let Shopify add the Google Analytics code to your Shopify pages for you, don't add the code to your theme.

Make sure you've entered your Google Analytics tracker ID on your Preferences page under General Settings.

Scroll down and look under Google Analytics:


Image:Without_this_no_go.png ‎

Important note on pageTracker._trackPageview

Since https://checkout.shopify.com is different from the domain of your shop, you may wonder how Google Analytics tracks visits to your checkout pages. Shopify is renaming the page view on each of your checkout pages using the JavaScript function pageTracker._trackPageview. Google Analytics uses this page view as URL. Which explains why you can still use relative links in your goals and funnels definitions. The actual URL of the checkout page is irrelevant for Google. More information on renaming pageviews can be found in this Google article.

To determine yourself, by inspection, which URL Shopify is provided to Google for a specific checkout page, do a View Source on said page in your browser. Look near the end of your document. For example, on page 1 of checkout, you'll see this:

<script type="text/javascript">
var pageTracker = _gat._getTracker('UA-xxxxxxx-1');
pageTracker._setAllowLinker(true);
pageTracker._setDomainName('none');
pageTracker._trackPageview('/checkout/carts/show');
</script>

This means that Shopify is telling Google that the URL of this page is /checkout/carts/show.

Learn by example: Setting up a Goal with a Funnel

So you've got a product page and want to analyse traffic from that page all the way to the Thank you page.

On your Google Analytics home page, at https://www.google.com/analytics/settings/home, click on the Edit link in the right column.


Image:Edit_ga.png‎


Under Goals, click on the 'Add goal' link. This will bring you to a page where you'll fill up that information:

  • Goal Name: Some name
  • Active Goal: On
  • Goal Type: URL Destination
  • Match Type: Head Match
  • Goal URL: /checkout/orders/show
  • Case Sensitive: [ ] unchecked


Image:Add_goal.png


At the bottom of the form click on the 'Yes, create a funnel for this goal' link.

Use these steps:

  • Step 1: /products/my-awesome-product
  • Step 2: /cart
  • Step 3: /checkout/carts/show
  • Step 4: /checkout/orders/pay

Replace the URL of Step 1 with the URL of your product page.


Image:Google_Chrome.png‎