This article describes why and how to optimize the value of a context attribute and includes a number of use cases.
Table of Contents
- Overview
- Optimizing the the average value of all sessions
- Instrumenting numeric session data attributes for optimization
- Use Cases
Overview
Optimizing a value in the digital experience can be an effective way to test ideas that affect revenue and engagement.
The conversion value is a scalar quantity you want the system to optimize. When optimizing a value, you must also identify a conversion event. This value is calculated for each session where the specified conversion event occurs.
Here are examples of Optimization Metrics that include a conversion value:
- Order Value (value) when a visitor reaches the thank you page (event)
- Video Minutes Watched (value) when a video is played (event)
- Lead Score when a lead form submission is confirmed
- Funnel progression value when a visitor makes progress down the funnel (a valuation of the distance a user goes in the funnel)
To learn more about Optimization Metrics, read: Understanding optimization metrics and how they can be used
Optimizing the average value of all sessions
When optimizing a value, the system will make decisions based on the average of all sessions.
Note that a value is only attributed to sessions that fire the specified conversion event.
There are two levers that can impact the average value of all sessions:
- Increase the conversion rate
- Increase the value of a session
The following table shows how these work:
- A value is recorded for each session where the designated conversion event is fired.
- Sessions in which the conversion event is not fired are considered 0 value.
Examples of ways to increase the performance of a value
Instrumenting numeric context attributes for optimization
Setting the context attribute in your digital experience
Context attributes are recorded in a visitor’s session and are set using custom code added to your digital experience.
Context attributes can be set using code from one of our SDKs. Below is an example using the Evolv Javascript SDK:
// Example
evolv.context.set('order_value', 15.00);
Add the context attribute to the Schema
To collect, process, and use context attribute values in performance calculations, they must first be defined in the Schema. The Schema is a set of definitions that describe data in the visitor’s context.
To learn how to define values in the Schema, read Adding context attributes to the Schema.
Setting the optimization metric conversion value
After you have edited the schema and published the change to all environments, navigate to the Optimization Metric setting in your project. The target fields you defined in the schema will appear in the Conversion Value field under Optimization Metric.
Use Cases
Order Value (E-commerce)
Increasing the average order value is a common optimization strategy for e-commerce experiences.
Define the order value in the schema and use the Avg function to process the session data received from the source.
Schema Definition
Use ‘Avg’ to calculate the average order value of multiple orders in the same session.
Source Field | Target Field | Function |
order_value | order_value | Avg |
Code (Example Javascript SDK)
The following code should run once the order is completed.
// Fire conversion event
evolv.client.emit(‘completed_order’);
// Set value of the order to the context attribute
evolv.context.set(‘order_value’, 15.00);
Engagement (Streaming Service)
There are many ways to optimize retention in a streaming subscription service. Increasing engagement is one strategy to increase retention, for example:
- Increase the number of videos started
- Increase the total number of minutes watched
Note – When a target field is added to the schema, it can be selected as a conversion value in an Optimization Metric. However, only one field can be optimized at a time, allowing the others to be monitored in the project performance reports.
Schema Definition
Source Field | Target Field | Function |
videos_started | videos_started | Sum |
video_minutes | video_minutes.total | Sum |
video_minutes.max | Max |
Code (Example Javascript SDK)
The following code should run once the order is completed.
// Fire conversion event
evolv.client.emit(‘played_video’);
// Set the value of a single video played to the session context.
// The SUM function will tally the count of videos played
evolv.context.set(‘videos_started’, 1);
// Set number of minutes played when a user leaves a video
evolv.context.set(‘video_minutes’, 55);
Lead Score (Marketing Funnel)
Every interaction in a digital experience has some level of value associated with it. Consider user engagement actions such as email sign-up or creating an account. They might not be your primary goal, but their business values can be used to calculate a lead score for a sales team.
You can calculate and optimize a lead score by firing the same conversion event (e.g., "user_engaged") for each action and setting a corresponding value for the interaction. The sum of all actions in a session can be tallied to get a lead score.
You can also fire multiple events at the same time. This is helpful if you want to emit a second event to describe the specific action.
Schema Definition
Set the target field function to "Sum" to optimize for the highest combined value of the session.
Source Field | Target Field | Function |
lead_score | lead_score | Sum |
Code (Example Javascript SDK)
// Fire the conversion event, specific secondary event, and set the lead score with each interaction
// Add value of email subscription
evolv.client.emit(‘user_engaged’);
evolv.client.emit(‘subscribed_to_email’);
evolv.context.set(‘lead_score’, 4);
// Add value of account creation
evolv.client.emit(‘user_engaged’);
evolv.client.emit(‘created_account’);
evolv.context.set(‘lead_score’, 10);
// Add value of quote request
evolv.client.emit(‘user_engaged’);
evolv.client.emit(‘requested_quote’);
evolv.context.set(‘lead_score’, 20);
Maximizing affiliate clicks
Optimize for the highest value affiliate clicks.
Schema Definition
Set the target field function to "Max" to optimize for the highest value affiliate link.
Source Field | Target Field | Function |
affiliate_value | affiliate_value.max | Max |
Code (Example Javascript SDK)
// Fire the conversion event and set the value of the affiliate linked clicked
// Set the value of the link
// Affiliate Link 1 = $5
evolv.client.emit(‘clicked_affiliate_link’);
evolv.context.set(‘affiliate_value’, 5);
// Affiliate Link 2 = $10
evolv.client.emit(‘clicked_affiliate_link’);
evolv.context.set(‘affiliate_value’, 10);
// Affiliate Link 3 = $15
evolv.client.emit(‘clicked_affiliate_link’);
evolv.context.set(‘affiliate_value’, 15);