1. Home
  2. Analytics
  3. How can I A/B test my Nudges?

How can I A/B test my Nudges?

Adding Nudges to your website can increase your conversion rate by 15%. If you want to go through a testing process of the uplift of your Nudges on your site, you can do an A/B test.

Nudgify does not have a built in A/B testing feature, but you can easily test your Nudges with A/B testing software. In this article, we show how you can A/B test your Nudges with Google Optimize.

How does A/B testing your Nudges work with Google Optimize?

Log in to your Google Optimize account, or create a new one. There are different ways that you can run an experiment for your Nudges. We are outlining 3 ways below, matching 3 relevant experiment options.

Experiment option 1: Nudges vs. no Nudges

This option allows you to test purely Nudges versus no Nudges. If you’d like to know by how much your Nudges are improving your conversion rates, you can run an experiment where on one variant of your site, you show no Nudges, and on the other variant you show your Nudges.

You can set this up by removing your Nudgify Pixel from your website and paste it in the JavaScript box in the Google Optimize editor instead. This way, the Pixel and your Nudges are only added to Variant of your site and not to the Original.

Follow the steps below to set it up:

  • Remove the Nudgify Pixel from your site
  • In the Google Optimize editor, click the code icon < > in the top right
  • Click Global JavaScript
  • Paste your Nudgify Pixel in the box that pops up
  • Remove the <script> tags
  • Click Apply

That’s it!

Now you have added your Nudges to the Variant of your page. You can now launch your A/B test and see how your Nudges are performing via Google Optimize.

Experiment option 2: Test Stream 1 vs. Stream 2

This option has virtually endless possibilities. You create two Streams and add any Nudges that you want to each of the Streams. This way, you can test, for example, the Purchase Nudge versus the Review Nudge, or a Stream with 3 Nudges versus a Stream with 4 Nudges.

You create two Streams with the same targeting rule(s). By default, the first Stream in your Streams list that matches the targeting rules is the Stream that will display on the page. The other Stream simply won’t show. Via Google Optimize, you can push the second Stream in your Variant. This way, the Original shows Stream 1 and the Variant shows Stream 2.

Follow the steps below to set it up:

  • In Nudgify, Create two Streams with the same targeting rules. For example, if you wanted to do an A/B test for your home page, create two Streams that target your home page. You could call them “Home Page Original” and “Home page Variant”.
  • Add the Nudges you want to each of the Streams
  • In the Google Optimize editor, click the code icon < > in the top right
  • Click Global JavaScript
  • Paste the following code in the box:
window.nudgify = window.nudgify || {};window.nudgify.bootOptions = 
window.nudgify.bootOptions || {streamOverride: 11233};

You should replace 11233 with the actual stream id of your Variant Stream. You can find the id of each Stream in the URL when you edit your Stream.

That’s it! Your “Home page Original” Stream will show on your Original page and “Home page Variant” Stream will show on your Variant. You can now launch your A/B test and see how your Nudges are performing via Google Optimize.

Experiment option 3: Hide specific Nudge types

This option allows you to test by hiding specific Nudges in your Stream on your Variant page, while still showing them on your Original page. You can achieve this by using CSS.

Each nudge type has added a “class”, for example: “toast-nudge-type-purchase” is the class for the Purchase Nudge. You can then use the following CSS to hide purchase Nudges:

.toast-nudge-type-purchase {
display: none !important;
}

To hide specific Nudge types in the Variant if your experiment, follow the steps below:

  • In the Google Optimize editor, click the code icon < > in the top right
  • Click CSS
  • Paste the follow code in the box that pops up
    .toast-nudge-type-purchase {
    display: none !important;
    }
  • Click Save

This way, you hide the purchase Nudge type on the Variant page. If you want to hide other Nudge types than the purchase Nudge, replace “purchase” in the code with one of the other Nudge types, for example for the Visitor Nudge, replace “purchase” with “visitor”:

.toast-nudge-type-visitor {
display: none !important;
}

You can find the overview of the code you need to use for each Nudge type below:

Visitor Nudge: visitor
All Visitors Nudge: visitors
Review Nudge: review
Rating Nudge: reviews
Sign-up Nudge: conversion
All Sign-ups Nudge: conversions
Purchase Nudge: purchase
All Purchases Nudge: purchases
Ticket Sale Nudge: event_purchase
All Ticket Sales Nudge: event_purchases
Low Stock Nudge: stock_level
Selling Fast Nudge: selling_out
Free Delivery Nudge: free_delivery
Order Soon Nudge: delivery_date

That’s it! The Nudge type of your choice won’t be showing on your Variant page. You can now launch your A/B test and see how your Nudges are performing via Google Optimize.

How can I A/B test my Nudges on Shopify

Shopify handles all app scripts in their own Shopify script tag. It is therefore not possible to use the script in any way to set up an A/B test.

The only way to A/B test Nudges on Shopify is by hiding the Nudges via CSS. Users with sites on Shopify can add the following CSS to do so:

.ve-container-box,  #ve-plugins-container-topLeft, #ve-plugins-container-topRight, #ve-plugins-container-bottomLeft, #ve-plugins-container-bottomRight {
     display:none !important;
}

 

Updated on July 26, 2023

Was this article helpful?

Related Articles