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 format (Number) 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.
If you are not sure if Symplify 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 Revenue data should appear as extra columns 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.