How to report variable revenue with UET

How to report variable revenue with UET

Conversions can range from downloading white papers, to submitting contact forms and making purchases. Very often these conversions have a revenue value associated with them that you can use to track the Return on ad spend (ROAS) on Bing Ads. UET allows you to report revenue for this purpose.

Conversion goals allow you to track customer actions on your website, which can range from making purchases to signing up for reward programs. Each of these actions might have a different value to your business. You can associate a different dollar amount (revenue value) to your conversion goals 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.

There are two steps to setting up variable revenue:

  • Add a default revenue value to an existing destination or event conversion goal in Bing Ads
  • Edit the UET tag tracking code to support variable revenue on your website

Requirements

Before you can set up variable revenue, make sure you have completed the following:

Step 1: Set up variable revenue conversion tracking in your Bing Ads account expando image
You need to make sure that the destination URL or event conversion goal is set up for variable revenue.
  1. Click the Campaigns tab, and then on the left pane, click Conversion Tracking.
    Conversion tracking menu
  2. Under Conversion Tracking, click Conversion Goals.
    Conversion tracking menu
  3. In the Type column, find a destination URL or event conversion goal. If you don't have one, click Create conversion goal to create one.
  4. Select the destination or event conversion goal, and then click Edit and Edit goal.
  5. Click Next.
  6. Under Revenue value, select the The value of this conversion action may vary (for instance, by purchase price) checkbox, and then enter the default amount and select the default currency to be used when no value is received for a conversion. Note: Currency won't be available if the scope is set to All accounts.
  7. Click Save.
Note

To see the complete list of currencies available for conversion goals, see Conversion Goal Revenue Currencies.

Step 2: Add or modify the UET tag tracking code on your website expando image

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 the UET tag to my website? but make sure you add the tag to the body section of the conversion goal confirmation page.

Here is an example for how to pass variable revenue for a destination URL type goal in PHP pages. In this 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.

To add the code to PHP pages using your webpage editor, see the sample UET tag tracking code below, and then manually add the areas that are highlighted.

<body>
<script>
(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[] ,f=function(){var o={ti:"TAG_ID_HERE"}; o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")} ,n=d.createElement(t),n.src=r,n.async=1,n.onload=n .onreadystatechange=function() {var s=this.readyState;s &&s!=="loaded"&& s!=="complete"||(f(),n.onload=n. onreadystatechange=null)},i= d.getElementsByTagName(t)[0],i. parentNode.insertBefore(n,i)})(window,document,"script"," //bat.bing.com/bat.js","uetq");
</script>
<noscript>
<img src="//bat.bing.com/action/0?ti=TAG_ID_HERE& Ver=2" height="0" width="0" style="display:none ; visibility: hidden;" />
</noscript>

<script>
 function GetRevenueValue()
   {
      return 6;
    }
</script>

<script>
window.uetq = window.uetq || [];
window.uetq.push({ 'gv': GetRevenueValue(), 'gc': 'CURRENCY_CODE_HERE'});
</script>

</body>

  1. Open your conversion confirmation page file. If multiple pages are generated from the same file, find the section in the file which generates your conversion page.
  2. Add or confirm that your site has a JavaScript function that defines variable revenue. In the above code, it is:

    <script>
     function GetRevenueValue()
       {
          return 6;
        }
    </script>

    You’ll need to replace this section with your own JavaScript function.

  3. Append the uetq.push code to the end of the UET tag tracking code to associate the revenue value with a conversion goal. Update the amount value for 'gv' parameter with value defined in step 2. In the above code, it is:

    <script>
    window.uetq = window.uetq || [];
    window.uetq.push({ 'gv': GetRevenueValue(), 'gc': 'CURRENCY_CODE_HERE' });
    </script>

    Note: To see the complete list of currencies code, see Conversion Goal Revenue Currencies. You can remove the 'gc' parameter if no currency is set in the conversion goal.

  4. Make sure the modified UET tag tracking code is added to the body of the conversion confirmation page, which is the page the customer sees after they complete the action you want to track. For example, the Purchase confirmation page.

    Tip: Search for the </body> tag and place the UET tag tracking code immediately above it.

  5. Save and upload the page to your web server.
Advanced: Code samples for event conversion goals and non-JavaScript UET tag tracking codeexpando image

Now that you know the code to append to the end of the UET tag tracking code for destination URL conversion goals, here are a few others you might want to try:

Event conversion goal

There is different code you need to append to report variable revenue for an event conversion goal. If you are using the same JavaScript function as in Step 2, it would look like this:

<script>
window.uetq = window.uetq || [];
window.uetq.push({'ec': event category, 'ea': event action, 'el': event label, 'ev': event value, 'gv': GetRevenueValue() , 'gc': 'CURRENCY_CODE_HERE'})
</script>

Note: To see the complete list of currencies code, see Conversion Goal Revenue Currencies.

Non-JavaScript UET tags

The non-JavaScript UET tag is the <noscript> section of the JavaScript UET tag tracking code.

<noscript>
<img src="//bat.bing.com/action/0?ti=TAG_ID_HERE& Ver=2&gv= GetRevenueValue()&gc='CURRENCY_CODE_HERE'" height="0" width="0" style="display:none ; visibility: hidden;" />
</noscript>

To learn about the difference, see JavaScript vs. Non-JavaScript UET tag tracking code. To see the complete list of currencies code, see Conversion Goal Revenue Currencies.

See more videos...