Shopify A/B Testing Integration Convert Experiences

Would you like to do A/B and/or multivariate testing on your Shopify store with Convert Experiences? 

This is possible, read more below...

Step 1: Convert Experiences Project Code

In Convert Experiences, retrieve the project ID number from Project Settings as shown in the image below. 

Step 2: Add the Convert Experiences Code to Shopify

To integrate the two platforms, please go to Sales Channels > Online Store > Themes > More Actions > Edit Code

Select the theme.liquid layout and paste the tracking code just before the first "{% if %}" section, as shown in the screenshot below:

In the area indicated above, paste the code shown below. Make sure you replace the project ID number with your own ID that you got from the Project Settings page mentioned earlier in this article.

See the Pen Shopify Integration - Step 2 - Shopify Tracking Code by George Crewe (@gcrewe) on CodePen.

Don't forget to save your changes in Shopify.

Step 3: Add the code to the Checkout Pages

We need to add the Convert Experiences tracking code to the checkout pages as well to be able to track conversions. For that, we will use Checkout Settings where you can add additional scripts.

Go to Settings > Checkout and scroll down to the Additional Scripts section. In the "Additional Scripts" form field paste the following code:

See the Pen Shopify Integration - Step 3 - Vanilla Simple Shopify Tracking Code by George Crewe (@gcrewe) on CodePen.

Replace the text, "XXXXX-XXXXX" with the Project ID found in your Project's Settings (the same screen where you can find your Convert Experiences tracking code).

Here is an example of the complete script:

See the Pen Shopify Integration - Step 3 - Sample Shopify Tracking Code by George Crewe (@gcrewe) on CodePen.

Step 4: Add the checkout page domain to your Project's Active Websites

On Shopify, the checkout pages are either presented under a central Shopify subdomain (checkout.shopify.com) or your own domain, depending on the type of Shopify account you have. In either situation, you need to add that domain to your Project's settings:

Step 5: Forward tracking cookies to the checkout domain

If you are not using your own domain or if you are using a totally different domain than your main domain for the checkout pages, you will need to manually forward the tracking cookies so that experiments fired on the shop pages can be connected later on to a conversion. To do that, on the cart page where the visitor redirects from your main domain, you need to read the convert tracking cookies and forward them to the checkout domain as explained below.  

Go to Online Store > Themes > Current Theme > Actions > Edit Code  as explained in step 2). Go to "Sections" and select the "cart-template.liquid". Then, add the following JavaScript, just before the <form> tag:

See the Pen Shopify Integration - Transferring Cookies Script by George Crewe (@gcrewe) on CodePen.

Next, add the following inside the <form> tag:

See the Pen Shopify Integration - Step 5 onsubmit event by George Crewe (@gcrewe) on CodePen.

After this, you should be done. Now, the Convert Experiences cookies should be forwarded to the checkout URL as two GET variables: _conv_v and _conv_s;

Note: If you use a subdomain of your main domain for checkout, then you probably do not have to complete this step. Cookies will be saved under the root domain, making them available on the shop and checkout pages.

Step 6: Manual Revenue Tracking

If you have not set up revenue tracking through Google Analytics, please install revenue tracking code under Settings > Checkout > Additional scripts:

See the Pen Shopify Integration - Manual Revenue Tracking by George Crewe (@gcrewe) on CodePen.

In the above code, XXXX is the goal ID to which the revenue is going to be attached and can be found in your Convert Experiences account.

Step 7: Verify your Shopify installation

You should verify your installation using the following guide: Shopify Setup Verification Guide

Have more questions? Submit a request

Comments