- Optimizely Web Experimentation
- Optimizely Performance Edge
If you have multiple products or checkout funnels you want to track independently, Optimizely Web Experimentation and Optimizely Performance Edge have that flexibility by adding the revenue tag to any custom event. See Configure revenue tracking in Optimizely Web Experimentation for information.
revenue
tag, regardless of the event name and which project or product the event tracking is instrumented for. Overall revenue and custom revenue tracking events
Optimizely Experimentation gives all projects overall revenue as a metric that you can add to any experiment. Overall revenue is not an event. No conversion in the Experimentation Events Export data has the name overall revenue. There is no event API name or ID. Instead, overall revenue is a special calculation Optimizely does on the Optimizely Experimentation Results page based on events generated by visitors bucketed in the experiment.
To generate overall revenue, Optimizely looks for events that meet the following two conditions:
- Events that have a revenue tag.
- A revenue tag with a value greater than $0.
Regardless of the event name, overall revenue is a conversion towards the overall revenue metric if an event meets the previous criteria.
On the other hand, custom revenue tracking events are actual events sent to Optimizely Experimentation using the Event API. Optimizely records these events as conversions, calculated on the Optimizely Experimentation Results page as a stand-alone metric. The number of conversions for a custom revenue tracking event is specific to that custom metric. The revenue value calculated is the sum of the revenue tag values associated with the custom event with that name only.
Decide when to use overall revenue
Depending on your site's funnels and the revenue values you want to track independently, you must carefully decide if the overall revenue metric works for you. If you choose to track multiple revenue streams on your site, you must create a custom event that tracks every revenue stream independently or create custom events to track revenue to take the place of the overall revenue metric.
Because overall revenue is a sum of events with a revenue tag, ensure that the values consumed by overall revenue are accurate. If you have configured a revenue tracking event, then an event totalRevenue
is placed on your confirmation page, capturing all revenue. Overall revenue calculates all revenue on your site by reading the totalRevenue
event's revenue tag. Adding additional revenue events that track one product line within the funnel can cause overall revenue to become inflated if those products are already tracked in the totalRevenue
event. You must adjust your configuration.
Keep the overall revenue metric
To keep the overall revenue metric, remove any revenue events that capture all revenue transactions. Create an event for each product line or revenue stream through your checkout. When a visitor checks out, you should capture all products in the cart by only one revenue event. Ensure that no product or dollar amount is unaccounted for, as this can cause revenue to be missed.
You cannot remove overall revenue from the project, so it may be helpful to continue using this metric to prevent confusion.
Replace overall revenue with totalRevenue
If there are too many products to create custom events for, or you cannot accomplish the complexity of capturing each item in the funnel, you can use a custom event that collects all revenue instead of the overall revenue metric.
For this approach, there are two parts. Configure an event that tracks all revenue, regardless of the product purchased. If you configure totalRevenue
, then you can use this metric. Ensure that you add the custom event to your project.
The second step is to configure logic that evaluates the revenue for just the products you want to track independently. You should then convert the revenue to cents and store it as a unique variable. Create a custom event designated to track just that product, and pass the custom variable as the value to the revenue tag.
You can add this event to the same page as the totalRevenue
event. When a visitor checks out and purchases the special item along with other items, both events occur at the same time.
Example: Track multiple streams of revenue
If you want to track multiple types of revenue on your site, you can create custom events that include the revenue tag. Adding the revenue tag does the following:
- It passes a value to Optimizely Experimentation.
- It marks the event to be tracked by overall revenue.
revenue
tag, regardless of the event name and which project or experimentation product the event tracking is instrumented in.An example is if your site has multiple revenue funnels or products you want to track individually. Assume you have an ecommerce site that sells two types of products: widgets and wingdings. This store wants to track all the revenue on the site, but also wants to track the revenue for each product separately. To do this, create a custom revenue event for widgets and a second custom event for wingdings. Because these are the only two products on this ecommerce site, by tracking the revenue for both these products, all revenue through the funnel is covered, and the overall revenue metric is used.
Example: Create a custom event for each revenue stream
- Go to Implementation > Events if your account does not have the metrics module enabled, or go to Metrics > Events if it does.
- Click Create New Event.
- Select Custom.
- Enter a Name.
- Edit the API Name if desired. This field automatically populates from the Name.
- Copy the code from Tracking Code > API tracking code and place the code on the confirmation page of the checkout funnel. This ensures the transaction was successful before sending the event.
- Click Save Event.
- Repeat the steps for each revenue event you want to track.
If you are working with the scenario outlined previously, you should create two custom events, one custom event to track each of the two products (widgets and wingdings).
If you have more products that are not covered by the metrics tracked independently, use the previous steps to create an all revenue event. If you choose to track all revenue through a custom event, do not use overall revenue. Overall revenue counts the individual product events, and the all revenue event, which causes overall revenue to display inflated.
Example: Create custom logic to isolate the revenue streams
Next, create custom logic that passes the value for each revenue stream into a variable that can be passed to Optimizely Experimentation using the custom Event API. Each revenue stream needs its own independent variable that is associated with a specific revenue custom event. Ensure that the value passed is converted into a single currency denomination and converted to cents before the value is passed to the revenue tag of the custom event.
You should place the revenue tracking events on the confirmation page after a successful transaction has occurred. You can add multiple revenue events to the same page as long as the variable used to pass the transaction amount to the revenue tag is evaluated independently for each event.
For the example of two revenue events, the confirmation page logic may look something like the following:
//pass the total purchase amount of just widgets var valueOfWidgets = ‘youDefineThisWidgetsValue’; //pass the total purchase amount of just wingdings var valueOfWingdings = ‘youDefineThisWingdingsValue’; // Convert all revenue into cents var widgetsInCents = valueOfWidgets * 100; var wingdingsInCents = valueOfWingdings *100; window["optimizely"] = window["optimizely"] || []; window["optimizely"].push({ "type": "event", "eventName": "trackWidgetRevenue", "tags": { "revenue": widgetsInCents } }); window["optimizely"].push({ "type": "event", "eventName": "trackWingdingRevenue", "tags": { "revenue": wingdingsInCents } });
If you decide not to use the overall revenue metric and instead want to configure your own custom event, then create an additional goal that captures all revenue in addition to each revenue stream. The code for this on the confirmation page looks something like the following:
//pass the total purchase amount to a variable var value = ‘youDefineThisTotalValue’; //pass the total purchase amount of just widgets var valueOfWidgets = ‘youDefineThisWidgetsValue’; //pass the total purchase amount of just wingdings var valueOfWingdings = ‘youDefineThisWingdingsValue’; // Convert all revenue into cents var valueInCents = value * 100; var widgetsInCents = valueOfWidgets * 100; var wingdingsInCents = valueOfWingdings *100; window["optimizely"] = window["optimizely"] || []; window["optimizely"].push({ "type": "event", "eventName": "trackRevenue", "tags": { "revenue": valueInCents } }); window["optimizely"].push({ "type": "event", "eventName": "trackWidgetRevenue", "tags": { "revenue": widgetsInCents } }); window["optimizely"].push({ "type": "event", "eventName": "trackWingdingRevenue", "tags": { "revenue": wingdingsInCents } });
Finally, add the custom events to your experiment to track conversions for each revenue stream.
Pick the right revenue metric for your experiment
With the metric builder, you can decide the best way to break down data on the Optimizely Experimentation Results page using different combinations of the revenue events you have created. To demonstrate this, the following sections use the previous widgets and wingdings example.
Revenue metrics by total visitors
If you run an experiment that calls attention to your new wingding product, where the goal is to increase the number of visitors that purchase a product, then conversions by the visitor is a good approach.
- Go to Experiments or Optimizations and select the name of your experiment.
- Click Metrics.
- Select Custom Event Metric and select the Wingdings-Only Revenue event.
- Select Increase from the first drop-down list (because increasing revenue is considered a win).
- Select total revenue from the second drop-down list. This changes how Optimizely calculates the event. Instead of counting one conversion per instance of the event, Optimizely looks at the value passed with the revenue tag, takes a sum of those values, and displays the result in the form of currency.
- Select visitor from the third drop-down list. This becomes the denominator for the metric.
- Click Save on the Add Metrics window, then click Save on the Metrics dashboard.
When you run the experiment, you see revenue per visitor.
Revenue metrics by total conversions
If you have an experiment where you want to encourage visitors to buy more than one widget in a transaction, you should look at the number of conversions as a denominator. This measures if the amount spent increased for the visitors who made a purchase.
- Go to Experiments or Optimizations and select the name of your experiment.
- Click Track > Metrics.
- Select Custom Event Metric and select the Wingdings-Only Revenue event.
- Select Increase from the first drop-down list (because increasing revenue is considered a win).
- Select total revenue from the second drop-down list. This changes how Optimizely calculates the event. Instead of counting one conversion per instance of the event, Optimizely looks at the value passed with the revenue tag, takes a sum of those values, and displays the result in the form of currency.
- Select conversion from the third drop-down list. This becomes the denominator for the metric.
- Click Save on the Add Metrics window, then click Save on the Metrics dashboard.
When you run the experiment, you see revenue per conversion.
Comparing the results for the wingding revenue examples, the dollar amount is the same, but the data is much different. In the revenue per visitor example, you are closer to statistical significance, and the total improvement is much greater.
By changing the denominator from total visitors to the total population that converted to the event (total conversions), the population drops considerably. Notice that there is a much smaller improvement rate even though the revenue per conversion is substantially more. By removing all the visitors who spent $0, you can evaluate the difference in the totals of those who made purchases. As a result, the statistical significance takes more time and visitors when looking at metrics by conversion instead of by visitor.
Revenue metrics as a custom event
If you do not have a static confirmation page, but you still want to evaluate how many times the custom revenue event was triggered, add the wingding metric to the results page. Instead of changing the event type to total revenue, use total conversions.
This gives you a numeric value of how many times the revenue event was triggered.
Please sign in to leave a comment.