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 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.

Requirements

Before you start setting up variable revenue, make sure you have:

How to set up variable revenue reporting

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.
  2. Under Conversion Tracking, click Conversion Goals.
  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 value of this conversion action may vary (for instance, by purchase price). Then enter the default amount and select the default currency to be used when no value is received for a conversion.
  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
Note

If you are using a tag manager or if your site is hosted on a website platform, take a look at the "Add the UET tag tracking code using a tag manager" or "Add the UET tag tracking code using your website platform" section of this article for instructions on setting up UET tags.

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 below 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:

            <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>

<script> function GetRevenueValue() { return 6; } </script>
<script> window.uetq = window.uetq || []; window.uetq.push('event', 'event name', {revenue_value: GetRevenueValue (), 'currency': 'CURRENCY_CODE_HERE'}); </script>
  1. Open your conversion confirmation page file. If multiple pages are generated from the same file, find the section in the file that 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 'revenue_value' parameter with value defined in step 2. In the above code, it is:
    </script>
       window.uetq = window.uetq || [];
       window.uetq.push('event', 'event name', {revenue_value: GetRevenueValue (), 'currency': 'CURRENCY_CODE_HERE'});  
    </script>

    Notes
    • The command 'event' is always required, even if you're not reporting any Event action. If that's the case, you can set Event action either as:
      • Empty. For example:
        <script>
           window.uetq = window.uetq || [];
           window.uetq.push('event', '', {revenue_value: GetRevenueValue (), 'currency': 'CURRENCY_CODE_HERE'});  
        </script>
      • One of the following actions that might help you identify the event action in the future:
        add_payment_info, add_to_cart, add_to_wishlist, begin_checkout, checkout_progress, exception, generate_lead, login, page_view, purchase, refund, remove_from_cart, screen_view, search, select_content, set_checkout_option, share, sign_up, timing_complete, view_item, view_item_list, view_promotion, view_search_results
        For example:
        <script>
           window.uetq = window.uetq || []; 
           window.uetq.push('event', 'add_payment_info', {revenue_value: GetRevenueValue (), 'currency': 'CURRENCY_CODE_HERE'});   
        </script>
    • 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.

  4. Make sure you add the modified UET tag tracking code 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 goalsexpando 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('event', 'Event action', {event_category: 'Event category', event_label: 'Event label', 'event_value': 'Event value', revenue_value: GetRevenueValue (), 'currency: 'CURRENCY_CODE_HERE'});  
</script>

Note: To see the complete list of currency codes, see Conversion Goal Revenue Currencies.

Notes
  • To see an example of a variable revenue UET tag installed in the body of a webpage, visit this webpage (English only), right-click in the webpage, and then click View source or View page source depending on your browser.
  • As your webpage loads, it triggers the UET tag, resulting in a number of HTTP requests. The most important request is to "bat.bing" (the one that looks like "http://bat.bing.com/action/0?ti=..."). This request tells Bing Ads about the user visits to your webpage. You can use third-party tools such as Fiddler to monitor all the requests that your browser is making when your webpage loads.
  • For variable revenue, an additional HTTP request is triggered to report this value to Bing Ads. It is similar to the bat.bing but it has different parameters to report revenue (as opposed to just page visit).
  • You can validate the variable revenue tag using UET Tag Helper.

See more videos...