If you are using Shopify, please read this documentation on how to implement revenue tracking for Shopify.
Implementation
If you want to track revenue data (Total Revenue, Average Quantity, Average Order Value) in your statistics you need to add the callback function below on the page that will display these, usually your "Thank's for your order"/Confirmation page. You will need to populate the values and also handle currency conversion before the function is fired.
symplify.revenue.push({
"orderID": {{ orderID }}, // Required (String)
"orderValue": {{ orderValue }}, // Required (Number) (Use . for decimal numbers Ex: 100.50)
"itemQty":{{ itemQty }} // Required (Number)
});
Exchange the {{ }} with real values.
Example:
symplify.revenue.push({
"orderID": "123456",
"orderValue": 1200,
"itemQty":2
});
You also need to add a Goal with a Revenue fact in your project for the revenue data to appear on the result page for your project.
Important!
- Make sure that the order values you're about to push have loaded and are in the correct type (see example below) before the push executes.
- All values are required for the push to go through. We do not accept 0/null values.
- We do not handle currencies so you need to convert all values to the same currency for the calculations to be correct.
- We highly recommend to set up and activate an A/A-test (empty A/B-test) with a revenue goal set to make sure the script is gathering revenue data. To validate further also add a goal for orders with statements that become true on your 'thanksforyourpurchase' page to compare number of Conversions. Please note that these numbers might vary slightly due to the revenue push being an external function call (that requires correct values) versus goal statements that might just be an easy URL check.
If you are not sure if the Symplify-script has loaded when you run this. Use this setup to make sure:
<script>
/* Revenue tracking */
if(typeof symplify !== 'undefined') {
symplify.revenue.push({
"orderID": {{ orderID }} // Required (String)
"orderValue": {{ orderValue }} // Required (Number) (Use . for decimal numbers Ex: 100.50)
"itemQty":{{ itemQty }} // Required (Number)
});
} else {
document.addEventListener("symplify-loaded", function() {
symplify.revenue.push({
"orderID": {{ orderID }} // Required (String)
"orderValue": {{ orderValue }} // Required (Number) (Use . for decimal numbers Ex: 100.50)
"itemQty":{{ itemQty }} // Required (Number)
});
});
}
</script>
Example statistics
If implemented correctly the Average revenue per visitor (ARPV) and Average order value (AOV) should appear as extra tabs in each goal that has a Revenue fact (and has received data).
Notice that if there are more than 1000 transactions the Remove Outliers checkbox is checked by default. How we handle outliers.