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 Microsoft Advertising. 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 Microsoft Advertising account expando image
You need to make sure that the destination URL or event conversion goal is set up for variable revenue.
  1. From the top menu, select Tools > Conversion goals.

    If you're using the new Microsoft Advertising navigation, from the navigation menu on the left, hover over Conversions and select Conversion goals.

  2. In the Type column, find a destination URL or event conversion goal. If you don't have one, select Create to create one.
  3. In the Goal name column, select the destination or event conversion goal's name.
  4. Set a Goal Category.
  5. Select Next.
  6. Under Revenue value, select Conversion action value 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. Select Next.
  8. Select the appropriate Set up tagging option and select Save and next.
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
Notes
  • Do you use Google Tag Manager? Check out Set up UET tags using Google Tag Manager.
  • Do you use a different tag manager? Take a look at the "Add the UET tag tracking code using a tag manager" section of this article.
  • Do you use a website-hosting service? Take a look at the "Add the UET tag tracking code using your website platform" section of this article.

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.

  1. Open the code file for your conversion confirmation page (the page the customer sees after they complete the action you want to track). If multiple pages are generated from the same file, find the section in the file that generates your conversion page.
  2. First, you'll need to add one of the following variable revenue JavaScripts:

    Important

    You must pass the currency value in capital letters. For example, 'currency': 'USD', not 'currency': 'usd'.

    1. For destination URL conversion goals: Add the following JavaScript below the UET tag that you have already added to your webpage's code:
      <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>

      Note

      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', '').

    2. For custom event conversion goals: Add the following JavaScript below the UET tag that you have already added to your webpage's code:
      <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'
  3. Next, make sure your webpage has a function that defines variable revenue:
    <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>

    Note

    When your revenue function passes values, it must use a period for decimals (as in 12.34), not a comma (as in 12,34).

  4. In the variable revenue JavaScript that you added in step 2, update the value for 'revenue_value' to match the name of the variable revenue function you added in step 3 (in this example, we changed "Replace_with_Variable_Revenue_Function()" to "GetRevenueValue()"):
    <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>
  5. In the same line, you have the option of specifying the currency you want the revenue value reported in (in this example, we changed "REPLACE_WITH_CURRENCY_CODE" to "GBP", for British pounds):

    Important

    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>

    Note

    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.

  6. Save and upload the page to your web server.
Notes
  • To see an example of a variable revenue UET tag installed in the body of a webpage, visit this webpage (English only), select and hold (or right-click) in the webpage, and then select 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 Microsoft Advertising 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 Microsoft Advertising. 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...