8. Tracking Revenue
Place this code on your order confirmation page
<script>
window.optimizely = window.optimizely || [];
window.optimizely.push(['trackEvent', 'eventName',
{'revenue': valueInCents}]);
</script>
'eventName' - This parameter is required. Can be any name you want to attach a
custom event to revenue (eg. Purchases)
valueInCents - should be the numerical representation of the purchase amount in
cents (purchase amount*100). eg. $54.99 should be passed as 5499.
11. Best Practices
Track revenue after a successful purchase
confirmation
Don’t trigger revenue based on a button click
Verify all revenue is being tracked correctly by
sending the order number over as the custom
event
Convert all currency before sending to
Optimizely
De-duplicate orders
12. Best Practices
if(priceInCents < 10000){
window.optimizely = window.optimizely || [];
window.optimizely.push(['trackEvent', 'orderComplete',
{'revenue': priceInCents}]);
}
Remove Outliers - Abnormally large orders can
substantially skew your average revenue per customer and
should generally be omitted from revenue tracking.
13. More Information
More information about revenue and more advanced
revenue tracking can be found on Optiverse:
https://help.optimizely.com/hc/en-us/articles/200039865