Ascend Life Cycle Events Implementation Documentation

Ascend has lifecycle events which enable you to track and store Ascend event data. Some common use cases are the following. 

  1. Making Ascend candidates (treatments) persist cross-device. 
  2. Sending event data to a 3rd party or in-house analytics tools for custom reports. 


Ascend Life Cycle Events Implementation Documentation

The following implementation details include information on getting Ascend experiment data for storage to enable support for cross-device user tracking and consistent treatments served to users.

Getting Ascend experiment data

To get the necessary Ascend information for storage you'll need to implement Ascend listeners immediately after the Ascend JavaScript snippet.

Namespace: ascend

Method Detail: ascend.on(event, callback)

The following sample code illustrates how to set an event listener immediately after the snippet.

<script src="//"></script> 

ascend.on('selected', function(data) 
//Store the following variables

Setting Ascend experiment data

To set the experiment data so the user sees the same treatment cross device you'll need to fetch the stored Ascend data then populate the window.AscendCandidate object.

The following is sample code to demonstrate how to set the information.

//Fetch the Ascend data using your own mechanism 
window.AscendCandidate = {"candidate_id" : candidateID, 
"user_id": userID, "experiment_id" : experimentID}

<script src="//"></script>

Passing an ID (e.g Adobe ID) to Sentient for storage

In order to pass the Adobe ID to Sentient, you'll need to populate the window.AscendUser object. Please see the following sample code for details

window.AscendUser = {"adobe_uid" : 123 } 

<script src="//"></script> 

Example code for lifecycle events provided below

var sentientEventsQueue = [];
var sentientEventsNames = [

var sentientEventsHandler = function(eventName, eventData) {
name: eventName,
data: eventData

var subscribeToSentientEvents = function() {
if (window.ascend) {
sentientEventsNames.forEach(function(eventName) {
ascend.on(eventName, function(eventData) {
sentientEventsHandler(eventName, eventData);

<script src="//" onload="subscribeToSentientEvents()"></script>
Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk