Conversion goals allow you to track what your customers do on your website, which can range from making purchases to signing up for reward programs. Each of these actions probably brings a different value to your business. That's why we let you associate a different, specific revenue value to each conversion goal to track your return on investment (ROI). This is called reporting variable revenue. Both the destination URL and event conversion goals can report variable revenue.
Before you start setting up variable revenue, make sure you have:
To see the complete list of currencies available for conversion goals, see Conversion Goal Revenue Currencies.
Next, you will want to edit the UET tracking code to support variable revenue. If you have already added the UET tag tracking code to your website, you can modify the tag in your website's code. If you haven't added the tag to your website yet, see How do I add a UET tag to my website?, but make sure you add the tag to the body section of the conversion goal confirmation page.
Let's look at how to pass variable revenue for a destination URL type goal in PHP pages. In the following example, it's reading a dynamic value for the variable revenue from a JavaScript function. You can just as easily send a static value or read from a JavaScript variable or HTML element.
You must pass the currency value in capital letters. For example, 'currency': 'USD', not 'currency': 'usd'.
<head>Your page title
</head>
<body>// Let's say this is where you pasted the UET tag.
<script>Your UET tag is here.</script>// Here is where to paste the following JavaScript:
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
</body>
Even though this isn't a custom event conversion goal (see next section), you still must include the command 'event'. For a destination URL goal, just leave the event action empty (as in, 'event', '').
<head>Your page title
</head>
<body>// Let's say this is where you pasted the UET tag.
<script>Your UET tag is here.</script>// Here is where to paste the following JavaScript:
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', 'Event action', {'event_category': 'Replace_with_Event_Category', 'event_label': 'Replace_with_Event_Label', 'event_value': 'Replace_with_Event_Value', 'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
</body>
For instructions on updating custom event parameters, take a look at How to track custom events with UET.
If you have already added JavaScript for custom events to your website's code, for this step, you'll just need to insert the variable revenue parameters:
'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': Replace_with_Variable_Revenue_Function(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...// Here is an example function, named "GetRevenueValue()", that defines variable revenue:
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
When your revenue function passes values, it must use a period for decimals (as in 12.34), not a comma (as in 12,34).
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': GetRevenueValue(), 'currency': 'REPLACE_WITH_CURRENCY_CODE'});
</script>
...
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
You must pass the currency value in capital letters. For example, 'currency': 'USD', not 'currency': 'usd'.
<head>Your page title
</head>
<body>
<script>Your UET tag is here.</script>
<script>
window.uetq = window.uetq || [];
window.uetq.push('event', '', {'revenue_value': GetRevenueValue(), 'currency': 'GBP'});
</script>
...
<script> function GetRevenueValue() { return 6; } </script>
...
</body>
To see the complete list of currency codes, see Conversion Goal Revenue Currencies. You can remove the 'currency' parameter if no currency is set in the conversion goal.