All Collections
1:1 Product Recommendations
Analytics
How to Push LimeSpot A/B Test Experience Details to Google Analytics
How to Push LimeSpot A/B Test Experience Details to Google Analytics

Learn how to push the LimeSpot A/B test experience details to Google Analytics.

W
Written by Will Wadman
Updated over a week ago

Google Analytics provides you the ability to understand your customers with deep insight. After you have set up an A/B test experience with LimeSpot, you can attach LimeSpot Experience details to your Google Analytics tracking as a "Custom Dimension", in order to get more detailed reports and funnel optimization based on the LimeSpot A/B testing that's running on your website. Here's what you have to do:

1. Login to your Google Analytics dashboard, click on ADMIN from the navigation bar, and select the Google Property that is associated with your online store. Click on Custom Definitions section, and select Custom Dimensions.

2. Create a new custom dimension on Google Analytics and call it "LimeSpot Experience" (or another name that you're comfortable with).

3. When you create a custom dimension in Google Analytics, a numeric value will be assigned to it as the index of that dimension. You can update this index by editing the dimension in the same place. Please take a note of the index associated with the new dimension for the next steps.

4. Add the appropriate script below to your website HTML <head> section (in Shopify, this is within your theme.liquid):

  • If you are using "Universal Analytics properties":

LimeSpot.ListenOnce(document, "lsReady", function () { 
ga('set', 'dimensionZ', LimeSpot.Context.ExperiencTitle);
});
  • If using Google Tag (gtag), and gtag is already initialized on your website:

LimeSpot.ListenOnce(document, "lsReady", function () { 
gtag('config', 'UA-XXXXXXX-Y', {
'custom_map': {'dimensionZ': 'LimeSpot Experience'}
});

gtag('event', 'user_authenticate', { 'LimeSpot Experience': LimeSpot.Context.ExperiencTitle });
});
  • If using Google Tag (gtag), and gtag is NOT initialized on your website elsewhere:

LimeSpot.ListenOnce(document, "lsReady", function () {   
LimeSpot.Storefront.LoadScript(
'https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXX-Y',
'pixel',
function() {
window.dataLayer = window.dataLayer || [];
function gtag(){ dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'UA-XXXXXXX-Y', {
'custom_map': {'dimensionZ': 'LimeSpot Experience'}
});
gtag('event', 'user_authenticate', { 'LimeSpot Experience': LimeSpot.Context.ExperiencTitle });
}
);
});

The scripts should NOT be added in this section:

Notes:

  • UA-XXXXXXX-Y should be replaced with your GA Property ID

  • Z in dimensionZ above needs to be replaced with the dimension index described in Step 3 above

  • limespot_experience should be replaced with the name you give the dimension on Google Analytics as desceibed in Step 2

  • If you need to learn more about custom dimensions and how to use them in Google Analytics, here is a link to Google's documentation around this.

Did this answer your question?