A/B testing with Google Optimize

A/B testing with Google Optimize

Managing an A/B test with our product is slightly more complex than your typical integration script. Simply omitting the script for a certain variant/user group raises the issue whereby a user may be  invited to a wish list, but won’t be able to see the list because they don’t have the script embedded in the web page.

Unfortunately, Google Optimize does not currently allow for deterministic group assignment rules, meaning we cannot force the invited friends to the test group so that they can join their friends.

Therefore, In order to run Joyned in an A/B test on Google Optimize you will have to setup two separate “experiences”:

  1. A 50/50 split test to show/hide Joyned for the general website traffic, excluding invited friends.
  2. A separate experience just for the users invited to your website via Joyned.
💡
For customers wishing to A/B test our product we offer fully managed testing capabilities. Let your customer success manager know and we can set it up for you without any additional integration.

Part 1 - setup the test for the general website traffic

Step 1 - Creating the “hide Joyned” variant

Click to create a new experience of type “A/B test”, then add a new variant and edit the website code, adding a “Global Javascript” here:

image

for the “hide” group - add this function as a “Global javascript”:

const joynedScript = document.createElement('script');
joynedScript.src = "https://cdn.joyned.app/latest/script.js?api_key=YOUR-API-KEY-HERE&lang=en&hide=1";
joynedScript.defer = true;
joynedScript.crossOrigin = "anonymous";
document.body.appendChild(joynedScript);

Step 2 - Creating the “show Joyned” variant

Add a new variant and edit the website code, adding a “Global Javascript” just like for the “hide” variant.

For the “show” group - add this function as a “Global javascript”:

const joynedScript = document.createElement('script');
joynedScript.src = "https://cdn.joyned.app/latest/script.js?api_key=YOUR-API-KEY-HERE&lang=en";
joynedScript.defer = true;
joynedScript.crossOrigin = "anonymous";
document.body.appendChild(joynedScript);
❤️
In both scripts, make sure to type in your assigned API key. If you do not have one, contact your customer success manager. Also, make sure to select your proper localisation using the &lang=[XX] parameter.

Step 3 - Edit the variant weights

edit the variant weights so that the original variant is at 0% and the hide-show are 50-50%.

Step 4 - exclude the invited users from the experiment

In order to prevent the invited friends from being sent to the “hide” group and diluting our experiment, we want to exclude them. We do this by identifying them based on the UTM campaign Joyned uses.

  1. in the “audience targeting” section, click “Customise”
  2. image
  3. Select “UTM parameter”
  4. image
  5. Setup targeting based on the UTM does not equal joyned
  6. image

That’s it! The end results should look like this:

image

Notice that:

  1. there are three test groups, and the first is defined at 0%
  2. the audience targeting excludes users coming with the UTM_campaign “joyned”

Part 2 - setup the test group for invited users

Now we will make sure that all the friends invited via Joyned all receive the Joyned script so that they can participate in the Joyned experience.

We do this by targeting only users with UTM campaign = joyned and adding the Joyned script to their website experience.

Step 1 - creating the variant

Click to create a new experience of type “A/B test”, then add a new variant and edit the website code, adding a “Global Javascript” here:

image

Add this function as a “Global javascript”:

const joynedScript = document.createElement('script');
joynedScript.src = "https://cdn.joyned.app/latest/script.js?api_key=YOUR-API-KEY-HERE&lang=en";
joynedScript.defer = true;
joynedScript.crossOrigin = "anonymous";
document.body.appendChild(joynedScript);
❤️
Reminder 1. Make sure to type in your assigned API key. If you do not have one, contact your customer success manager. 2. Make sure to select your proper localisation using the &lang=[XX] parameter.

Step 2 - Edit the variant weights

Edit the variant weights so that the original variant is at 0% and the invitee group is 100%.

Step 3 - include only invited users in the experiment

In order to include only the invited friends, we will identify them based on the UTM campaign Joyned uses.

  1. in the “audience targeting” section, click “Customise”
  2. image
  3. Select “UTM parameter”
  4. image
  5. Setup targeting based on the UTM equals joyned
  6. image

That’s it! the end result should look like this:

image

Part 3 - Launching the experiences

proceed to launch these two experience just like you launch any of your Google Optimize experiences.

Part 4 - Don’t forget to add the tracking code!

Our tracking code should be included for all website visitors to the checkout pages.

See our manual here: