Skip to content
This repository was archived by the owner on Mar 7, 2023. It is now read-only.

segmentstream/dbex-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Driveback Experiments

Driveback Experiments API helps to run client-side and server-side A/B/n tests on your website with simple API. You can use it either directly on your website or through you tag management system.

How to use

1. Add dbex.min.js in the head of your page

<script src="http://YOURWEBSITE.COM/js/dbex.min.js"></script>

Note: dbex.min.js file can be downloaded here.

2. Initialize Driveback Experiments

dbex('init', '<DRIVEBACK_EXPERIENTS_UUID>');

Driveback Experiments UUID can be obtained from Driveback admin panel:

alt tag

3. Create new experiment in admin panel

alt tag

Note: Once experiment is created you can obtain EXPERIMENT_ID from admin panel

4. Dynamically split you traffic and update website page based on variation

Example:

dbex(function() {
  var variation = this.chooseVariation('<EXPERIMENT_ID>');
  if (variation === 1) { // blue button
    jQuery('#but-now-button').addClass('blue');
  }
});

5. Track experiment session

Example:

dbex('trackSession', '<EXPERIMENT_ID>');

Note: should be called any time user sees (experiences) experiment

6. Track conversions for your Experiment

Example:

dbex('trackConversion', '<EXPERIMENT_ID>');

Example for tracking sales:

dbex('trackConversion', '<EXPERIMENT_ID>', 800);

7. Results are updated in admin panel every 60 minutes

alt tag

Client side A/B/n testing flow

dbex('init', '<DRIVEBACK_EXPERIENTS_UUID>'); // initialize
dbex(function() {
  var variation = this.chooseVariation('<EXPERIMENT_ID>');

  // make changes in UI based on varaition
  // ...
});
dbex('trackSession', '<EXPERIMENT_ID>'); // track experiment session

Server side A/B/n testing flow

dbex('init', '<DRIVEBACK_EXPERIENTS_UUID>'); // initialize
dbex('setVariation', '<EXPERIMENT_ID>', '<VARIATION_RETURNED_FROM_SERVER>'); //0, 1, etc

// make changes in UI based on varaition
// ...

dbex('trackSession', '<EXPERIMENT_ID>'); // track experiment session

About

Driveback Experiments SDK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •