Integrating Convert.com's Full Stack SDK and Web Testing for Enhanced A/B Testing


Integrating Convert.com's Full Stack SDK with the Web Testing project offers a powerful approach to conducting A/B testing, providing flexibility in how variations are assigned and ensuring accurate tracking of user interactions. By leveraging server-side logic for deterministic variation assignment and offering an alternative client-side bucketing option, businesses can tailor their experimentation strategy to fit specific needs. This comprehensive guide outlines both methods, ensuring that you can implement the one that best suits your testing requirements.

Setting Up Experiments

Full Stack Project

Begin by setting up your experiment in the Full Stack project. This setup focuses on server-side variation assignment, using the SDK's deterministic bucketing based on the murmur hash algorithm.

const convertSDK = require('convert-sdk')('YOUR_PROJECT_API_KEY');
const context = convertSDK.createContext('USER_UNIQUE_ID');
const variation = context.runExperience('EXPERIENCE_KEY');
console.log(variation); // Outputs the assigned variation
            

Web Testing Project

Create a corresponding experiment in the Web Testing project for client-side tracking and analysis of user interactions with the variations.

You should take into account that there will be two experiments running in parallel. One in the Full Stack Project and one in the Web Project. You should align the variations one to one. For example, the original in the Full Stack Project will align with the one in the Web Project.

window._conv_q = window._conv_q || [];
window._conv_q.push(['executeExperiment', 'WEB_TESTING_PROJECT_EXPERIMENT_ID']);

Communication Between Server-Side and Client-Side

If you decide to run the experiment server side using the Full Stack variation assignation, then you need to communicate this to the client side. You can do this in two ways.

  1. You can write some JS code server side to be run client side like this:

    window._conv_q = window._conv_q || [];
    window._conv_q.push(['executeExperiment', 'WEB_TESTING_PROJECT_EXPERIMENT_ID']);
        
  2. After assigning variations on the server-side, communicate this assignment to the client-side effectively by setting a specific cookie. This alignment is crucial for accurate tracking within the Web Testing project.

// Example using Node.js and Express for setting a cookie
 res.cookie('_conv_sptest', `FULL_STACK_PROJECT_EXPERIMENT_ID:VARIATION_ID`, { maxAge: 10000, httpOnly: true });

 

Analize the experiment data on the client side:

You can analyze the data on the web testing project experiment report. You can add your goals on the web project. This will allow you to leverage all the client side template goal and the analytics integrations such GA4.

 

Conclusion

Creating separate experiments in both the Full Stack and Web Testing projects enables a comprehensive framework for A/B testing. This approach leverages the advantages of both server-side assignment and client-side tracking for detailed insights and optimized digital experiences.

Need assistance? Start a conversation with our Support Team.
CONVERT MORE

Reliably Convert More Site Visitors, Even If Everything Else is Changing in Your Business.

START 15-DAY FREE TRIAL
✓ No Credit Card  ✓ Easy Set-Up  ✓ Access All Features

Comments