Setting up Sales Funnel across websites in Google Analytics

In this article, you will learn to set up Sales funnel in Google Analytics, when some of the funnel pages (including the order confirmation page) are hosted on another website.

This is quite common in case of affiliate websites and third party shopping carts, where the final part of the checkout process occurs on a different website):

cross domain tracking set up

The Sales funnel in Google Analytics

Following is the sales funnel, we are going to set up in Google Analytics, by using virtual pageviews and by setting up cross domain tracking between our website and the website which host the shopping cart:

funnel1

funnel2

funnel3

This sales funnel is made up of following funnel pages:

#1 Product detail pages – a product detail page shows all of the information about a product. Let us assume, that all of these pages are hosted on your website.

#2 Shopping Cart page – this page list all of the products in a shopping cart. Let us assume that this page is also hosted on your website.

#3 Contact information page – this page asks for customers email and shipping address and provide an option to enter discount code. Let us assume that this funnel page is on the different website which host the shopping cart.

#4 Shipping page – this page allows a website user, to select a shipping method. This funnel page is on the website which host the shopping cart.

#5 Payment page – on this page the user enter his credit card details and provide billing address (if it is different from the shipping address). This page also provide an option to enter discount code. This funnel page is on the website which host the shopping cart.

#6 Place an order page – This is an order confirmation page which is shown to a user once he has complete a purchase. This funnel page is on the website which host the shopping cart.

All of these pages together, make up my sales funnel.

I am now going to set up this sales funnel in Google Analytics by following the steps below:

Step-1: Map your entire sales funnel.

Step-2: Set up cross domain tracking between your website and the website which host the shopping cart.

Step-3: Configure the website which host the shopping cart to generate and send virtual pageviews.

Step-4: Set up sales funnel in Google Analytics and test it.

Get the E-book (52 Pages)

Get the E-Book (37 Pages)

#1 Map your entire sales funnel

Determine all of the web pages which make up your shopping cart. In my case, the sales funnel is made up of following pages:

#1 Product detail pages – https://www.mywebsite.com/collections/products/

#2 Shopping Cart page – https://www.mywebsite.com/cart

#3 Contact information page – https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=contact_information

#4 Shipping page – https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=shipping_method

#5 Payment page – https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=payment_method

#6 Place an order page – https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93/thank_you

#2 Set up cross domain tracking

By default, Google Analytics does not share cookie information (client ID) with another website.

Because of this reason, by default, you can’t track website user’s journey which span multiple domains.

In order to track user’s journey across domains, follow the steps below:

Step-1Allow your website (i.e. source domain) to pass cookie information (client ID) to the website which host the shopping cart (i.e. destination domain).

In order to accomplish this goal, add following line of code in the Google Analytics Tracking Code of your website:

ga(‘create’, ‘UA-12343-26’, ‘auto’,{‘allowLinker’: true }); // allow source domain to pass cookie information

Now your Google Analytics tracking code, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12343-26', 'auto',{'allowLinker': true });
  ga('send', 'pageview');

</script>

Step-2: Set up AutoLink plugin for your website.

This plugin is used to track cross domain traffic in Google Analytics. Add following line of code in the Google Analytics Tracking Code of your website:

ga(‘require’, ‘linker’); // setup autoLink plugin

Now your Google Analytics tracking code, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12343-26', 'auto',{'allowLinker': true });
  ga('require', 'linker');
  ga('send', 'pageview');

</script>

Step-3: Define the domain that need to be automatically cross linked

You can define the domain that need to be automatically cross linked by using the linker:autoLink’ Command.

Let us suppose the address of the website which host your shopping cart is anotherWebsite.com.

So here is how the linker:autoLink command can be used in that case:

ga(‘linker:autoLink’, [‘anotherWebsite.com’]); // Auto link to anotherWebsite.com

Add this line of code to the Google Analytics tracking code of the website.

Now your Google Analytics tracking code, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-12343-26', 'auto',{'allowLinker': true });
  ga('require', 'linker');
  ga('linker:autoLink', ['anotherWebsite.com']);
  ga('send', 'pageview');

</script>

Step-4: Allow the website which host the shopping cart (i.e. destination domain) to accept cookie information (client ID) from your website (i.e. source domain).

In order to accomplish this goal, add following line of code in the Google Analytics Tracking Code of the website which host your shopping cart:

ga(‘create’, ‘UA-196844-17’, ‘auto’,{‘allowLinker’: true }); // allow destination domain to accept cookie information

Now the Google Analytics tracking code of the destination domain, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-196844-17', 'auto',{'allowLinker': true });
  ga('send', 'pageview');

</script>

Step-5: Set up AutoLink plugin for the destination website. Add following line of code in the Google Analytics Tracking Code of the destination domain:

ga(‘require’, ‘linker’); // setup autoLink plugin

Now the Google Analytics tracking code of the destination domain, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-196844-17', 'auto',{'allowLinker': true });
  ga('require', 'linker');
  ga('send', 'pageview');

</script>

Step-6: Define the domain that need to be automatically cross linked – Let us suppose the address of your website is mywebsite.com. So here is how the linker:autoLink command can be used in that case:

ga(‘linker:autoLink’, [‘mywebsite.com’]); // Auto link to mywebsite.com

Add this line of code to the Google Analytics tracking code of the destination domain.

Now the Google Analytics tracking code of the destination domain, may look like the one below:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-196844-17', 'auto',{'allowLinker': true });
  ga('require', 'linker');
  ga('linker:autoLink', ['mywebsite.com']);
  ga('send', 'pageview');

</script>

As you can see, setting up cross domain tracking is not that hard. The problem really occurs, when you can’t change the Google Analytics tracking code of the destination domain, which host your shopping cart.

In that case, you can ask the developer/webmaster of the destination domain, to add following line of code (highlighted in bold) to his Google Analytics tracking code:

<script>
(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’,’//www.google-analytics.com/analytics.js’,’ga’);

ga(‘create’, ‘UA-196844-17’, ‘auto’,{‘allowLinker’: true });
ga(‘require’, ‘linker’);
ga(‘linker:autoLink’, [‘mywebsite.com’]);
ga(‘send’, ‘pageview’);

</script>

Note: replace mywebsite.com by your domain name.

Once this task is complete, the cross domain tracking is set up between your website and the website which host the shopping cart.

If the developer/webmaster of the destination domain, refuse to add the cross domain tracking code to his GA tracking code, then there is nothing much you can do, except change your shopping cart provider.

If you are using a popular shopping cart like Shopify, then you don’t need to ask them, to add the cross domain tracking code to their GA tracking code.

As soon as you enable the Google Analytics tracking in your shopify account, cross domain tracking will be automatically set up.

So when a user leave your website and move to the shopping cart (hosted by Shopify) to complete the checkout, the cross domain tracking is already there to track user’s activities between your website and the third party shopping cart.

To learn more about cross domain tracking, read the article: Cross Domain Tracking in Universal Analytics – demystified

#3 Configure destination domain to send virtual pageviews

You now need to configure the destination domain, so that it sends virtual pageviews for each funnel page.

For example, if a user visit the Contact information page (hosted on the destination domain), you can add the following code to the destination domain:

ga(‘send’, ‘pageview’, ‘/checkout/contact_information‘);

Here , ‘/checkout/contact_information’ is a virtual pageview which is generated and sent, whenever your website users, visited the ‘Contact information’ page hosted on the destination domain.

Configuring destination domain to send virtual pageviews, varies from domain to domain. The actual implementation depends upon the CMS and shopping cart being used by the destination domain.

So I can’t share a code, which you can use and configure your destination domain to send virtual pageviews.

If you are using a shopping cart like Shopify, you don’t need to configure the shopify website to send virtual pageviews to your GA property. You just need to identify the virtual pageviews, which Shopify generates for each funnel step.

To identify such virtual pageviews, follow the steps below:

Step-1: Navigate to the first funnel page, hosted on Shopify via Google chrome browser. In my case, the first funnel page hosted on Shopify, is the Contact information page (https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=contact_information)

Step-2: Right click on the web page and select ‘Inspect‘. This will open the ‘Google Developer Console

Step-3: Click on the ‘console’ tab and then search for the virtual pageview generated by the page:

shopify virtual pageview

The virtual pageview generated by the ‘contact information’ page is ‘/checkout/contact_information

Step-4: Use step 1 to 3, to determine the virtual pageview generated by each funnel page hosted on the destination domain. In my case, following would be the various virtual pageviews:

#1 Virtual pageview generated by Contact information page (https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=contact_information) – /checkout/contact_information

#2 Virtual pageview generated by Shipping page (https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=shipping_method) – /checkout/shipping

#3 Virtual pageview generated by Payment page (https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93?step=payment_method) – /checkout/payment

#4 Virtual pageview generated by Place an order page (https://checkout.shopify.com/3108721/checkouts/d7ba5d79341cdb6755266b811ed15d93/thank_you) – /checkout/thank_you

#4 Set up Sales Funnel in Google Analytics

Once you have documented the virtual pageviews for each funnel page, you can now set up the sales funnel in Google Analytics.

Follow the steps below:

Step-1: Create a new goal of type destination in your GA view.

Step-2: Configure the funnel steps as shown below:

final funnel1

final funnel2

Step-3: Carry out 2 or 3 test transactions, on your website and then check your funnel visualization report after couple of hours. If you see data for each funnel step, then your sales funnel is working.

Note: You can not use events as funnel pages in Google Analytics.

Similarly, you can also use virtual pageviews and cross domain tracking, to set up Goal funnel which spans across websites.

Other articles on specialized tracking in Google Analytics

  1. Ecommerce Tracking in Google Analytics – Tutorial
  2. Event Tracking via Google Tag Manager – Tutorial
  3. Event Tracking in Google Analytics – Tutorial
  4. Guide to Google Analytics Store Visits Tracking
  5. Offline Conversion Tracking in Google Analytics – Tutorial
  6. Implementing E-Commerce Tracking via Google Tag Manager
  7. Tracking Virtual Pageviews in Google Tag Manager – Tutorial
  8. YouTube Video tracking via Google Tag Manager
  9. How to Use Keyword Hero to Reveal Not Provided Keywords in Google Analytics
  10. Virtual pageviews in Google Analytics – Tutorial
  11. Google Analytics and YouTube Integration Tutorial
  12. Google Analytics for Facebook Tutorial
  13. Google Analytics Cross Domain Tracking Explained Like Never Before
  14. Using multiple Google Analytics tracking codes on web pages
  15. The one thing that you don’t know about PayPal.com and the referral exclusion list
  16. Calculated Metrics in Google Analytics – Tutorial
  17. Creating your own Google Analytics Tag Auditing System
  18. Tracking Site Search without Query Parameter in Google Tag Manager
  19. Tracking true referrals in Google Analytics when using PayPal and other payment gateways
  20. Phone Call Tracking in Google Analytics and Beyond
  21. Learn to Track Qualified and Won Leads in Google Analytics
  22. Introduction to Postbacks in Google Analytics
  23. Google Analytics Recurring Revenue and Subscriptions Tracking Tutorial
  24. How to track the impact of cookie consent on website traffic in Google Analytics
  25. Tracking Offline Conversions in Google Ads
  26. Implementing Scroll Tracking via Google Tag Manager
  27. Scroll Tracking via Scroll Depth Trigger in Google Tag Manager
  28. Site Search Tracking In Google Analytics Without Query Parameters
  29. Video Tracking via YouTube Video Trigger In Google Tag Manager
  30. How to Correctly Measure Conversion Date & Time in Google Analytics
  31. Google Analytics Social Tracking – Twitter, Facebook, Google Plus and LinkedIn
  32. Google Analytics Cross Domain Tracking (ga.js)
  33. Tracking Twitter and Linkedin Social Interactions in Google Analytics
  34. Creating Content Group in Google Analytics via tracking code using gtag.js
  35. Tracking Site Search in Google Analytics with Query Parameters
  36. Understanding site search tracking in Google Analytics
  37. Creating and Using Site Search Funnel in Google Analytics
  38. Learn to Setup Facebook Pixel Tracking via Google Tag Manager
  39. Setting up & Tracking AMP Pages in Google Analytics
  40. Setting up Sales Funnel across websites in Google Analytics
  41. Regular Expressions (Regex) for Google Analytics & Google Tag Manager – Tutorial

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and Beyond
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

Himanshu Sharma

Digital Marketing Consultant and Founder of Optimizesmart.com

Himanshu helps business owners and marketing professionals in generating more sales and ROI by fixing their website tracking issues, helping them understand their true customers' purchase journey and helping them determine the most effective marketing channels for investment.

He has over 12 years of experience in digital analytics and digital marketing.

He was nominated for the Digital Analytics Association's Awards for Excellence. The Digital Analytics Association is a world-renowned not-for-profit association that helps organisations overcome the challenges of data acquisition and application.

He is the author of four best-selling books on analytics and conversion optimization:

error: Alert: Content is protected !!