Recording checkouts in Shopify


If you are using Shopify's own checkout pages (checkout.shopify.com) this means that unfortunately you won't be able to track the checkout pages themselves. The reason is that, for security reasons, Shopify won't allow tracking or 3rd party javaScript in the the payment flow itself. They do however allow tracking of their 'thank-you-page' that customers land on when they have completed a purchase.

We highly recommend tracking the 'thank-you-page' as it will allow you to track customers enter and complete the checkout flow - providing an indicator of wether a transaction was successful or not.


The following guide will walk you through installing the Mouseflow tracking code on your Shopify 'thank-you-page' Pages:


  1. From the Shopify backend, go to Settings > Checkout > Order Processing and insert the Mouseflow Tracking code (see step 6 in the Shopify installation guide) in the box labeled "Additional Scripts". Click "Save".

  2. Now go to your Mouseflow account, open your website, then click Settings.
  3. Scroll down and click Advanced settings, then Select Regex from the Merge URLs field, and enter the following in the Pattern field:
    ^.*\/\d*\/checkouts\/\w*\/thank_you$
    You can also add an alias to make it easier to spot these pages collectively as Thank You Pages. Remember to click Save.  Remember to click Save.
  4. In the "Domains" field, enter checkout.shopify.com or your second domain and hit tab to add it to the list, remember to click Save.

  5. From here go to the Apps & Integrations menu and enable Cross-Domain Support to complete the configurations for the Shopify Checkout Pages.


    Note
    Each visit to the thank you/confirmation page has a randomly generated URL. This is normally a problem for funnels and heatmaps (which depend on a static URL) but is mitigated in the steps above.

    This allows you to track the thank you page by aggregating all possible variants that match a known pattern for that page URL into one combined URL. As such, look for ^\/\d*\/checkouts\/\w*\/thank_you$ (or if you have provided an Alias, look for that) in your funnel steps and heatmap list to study behavior on the thank you page. Shopify does not currently allow users to track the shipping and billing pages but, by filtering for users who visit the thank you page, you'll still be able to study drop-offs vs. conversions.