Note

Support wait times may be longer than usual. We're sorry for any inconvenience. Thank you for your patience.

Set up UET tags using Google Tag Manager

Third-party tag managers allow you to manage your website tags in one place. Learn how to set up UET tags using Google Tag Manager.
Notes
  • This article shows how to do a basic setup of UET tags with Google Tag Manager. Google Tag Manager offers several advanced features to customize when and how your tags are fired. Please refer to Google's Tag Manager Help for more information.
  • Microsoft Advertising is not responsible for Google Tag Manager's processes or documentation, nor for changes made to Google Tag Manager's processes or documentation.

Tag managers replace static tags with dynamic tags that are easier to implement and update. The dynamic tag is a container, a small snippet of code that allows you to dynamically insert tags into your website. You can think of the container tag as a bucket that holds other types of tags.

Implementing UET using Google Tag Manager expando image

To send information from Google Tag Manager to Microsoft Advertising, you need to create a "container" in Google Tag Manager and then add the Microsoft Advertising UET tag to it. Here's how:

  1. When you set up an account in Google Tag Manager, enter your website's URL in the Container name box.
  2. From the Overview page of this container's workspace, click the container ID (formatted like "GTM-XXXXXX") in the toolbar. You will see the Google Tag Manager container code and instructions.
  3. Copy the container code and paste it into the head or body section of every page of your website.
  4. Back on the Overview page of your container's workspace, click New tag.
  5. In the Tag Configuration pane, click the pencil icon.
    1. Under More, select Bing Ads Universal Event Tracking.
    2. Enter your Bing Ads UET Tag ID. You can find the tag ID in Microsoft Advertising by selecting Conversion Tracking > UET tags.
    3. If you have more than one UET tag tracking code on a webpage, enter the global event tracking object name within the UET tag script that you want Google Tag Manager to track into the UETQ Variable ID box. Otherwise, use the default "uetq" value. Learn more about reasons for creating more than one UET tag and how to rename the uetq event tracker.

      Note

      If you don't use a different uetq variable, the UET Tag Helper will return the "Multiple UET tags on this webpage use the same event name" issue. If you have multiple tags placed on the site and one of those is implemented through Google Tag Manager, it's possible that the UET Tag Helper will fail to detect the "Multiple UET tag on this webpage use the same event name" issue.

    4. For Event Type, select Page Load.
  6. In the Triggering pane, click the pencil icon and select All pages. A tag must have at least one trigger for it to fire. Triggers are evaluated during runtime and are fired when the trigger conditions are met.
  7. Click Save, enter a Tag Name, and then click Save.
  8. In the toolbar of your container's workspace, click Submit and then Publish to enable the tag and add a version.
  9. In Microsoft Advertising, select Conversion Tracking > UET tags to verify that you are receiving conversions. It typically takes up to 24 hours for a tag to be verified.
  10. Using the UET Tag Helper, browse your website and confirm that all pages fire the UET page load event.
Advanced: UET custom event and variable revenue reporting using Google Tag Manager expando image
Important

To set up custom events and/or revenue variables using Google Tag Manager, you must have added your UET tag to Google Tag Manager as described in the previous section.

Custom events and revenue variables are dynamic values, so you need to tell Google Tag Manager how to read them.

  1. Set up Google Tag Manager variables to read dynamic values from your page: While Google Tag Manager supports many variants (read from html elements, functions, variables, etc.), we'll set up Google Tag Manager variables to read JavaScript variables in this example.
    1. Visit our Google Tag Manager sample page (English only), right-click in the webpage, and then click View source or View page source depending on your browser. You will see the following variables:
      <script>
         var varEventCategory = "MyCategory";
         var varEventAction = "MyAction";
         var varEventLabel = "MyLabel";
         var varEventValue = 5;
         var varRevenue = 6;						
      </script>

      Important

      You'll need to make sure that the variables in your website's code match the custom event and/or variable revenue values that you set up when you created your conversion goal in Microsoft Advertising. But for the purpose of this example, let's say that you have the above variables in your website, and you want Google Tag Manager to read them.

    2. In your Google Tag Manager container's workspace, click Variables.
    3. Under User-Defined Variables, click New.
    4. In the Variable Configuration pane, click the pencil icon.
    5. Under Page Variables, select JavaScript Variable.
    6. In the Global variable name box, enter the variable — in this example, "varEventCategory".
    7. Click Save.
    8. In the Variable Name box, enter the name you gave this variable when you created the conversion goal. In our example, this would be "MyCategory".
    9. Click Save.
    10. Repeat the above process, creating a new variable for each custom event and/or variable revenue that you want to track, making sure to match the values that you set up when you created each conversion goal in Microsoft Advertising.
  2. Set up a trigger:
    1. In your Google Tag Manager container's workspace, click Triggers, and then New.
    2. In the Trigger Configuration pane, click the pencil icon and select Custom Event.
    3. Enter an Event Name, and click Save.
    4. Enter a Trigger Name, and click Save.

    Important
    • Your triggers in Google Tag Manager must match the possible interactions that are coded on your webpage.
    • Take a look at our Google Tag Manager sample page for an example. On this page, we have coded for a click on a button. Right-click in the webpage, and then click View source or View page source depending on your browser, and look for the code with "id=btnCustomEvent".
  3. Create a new tag: This secondary tag will tie together the event variables and trigger you just created.
    1. In your Google Tag Manager container's workspace, click Tags, and then New.
    2. In the Tag Configuration pane, click the pencil icon.
    3. Under More, select Bing Ads Universal Event Tracking.
    4. Enter your Bing Ads UET Tag ID. You can find the tag ID in Microsoft Advertising by selecting Conversion Tracking > UET tags.
    5. If you have more than one UET tag tracking code on a webpage, enter the global event tracking object name within the UET tag script that you want Google Tag Manager to track into the UETQ Variable ID box. Otherwise, use the default "uetq" value.
    6. For Event Type, select Custom.
    7. Add the variables that you created in step 1 within the respective Event Parameters boxes.
    8. In the Triggering pane, click the pencil icon and select the trigger that you created in step 2.
    9. Click Save, enter a Tag Name, and then click Save.
  4. Publish your changes: In the toolbar of your Google Tag Manager container's workspace, click Submit and then Publish.
  5. Check your website's code: Verify that you have placed the below variables on your website's conversion page (the page where customers complete their transactions). Also, ensure that the variable values match the event values within your goal setup. In our example:
    <script>
       var varEventCategory = "MyCategory";
       var varEventAction = "MyAction";
       var varEventLabel = "MyLabel";
       var varEventValue = 5;
       var varRevenue = 6;						
    </script>
  6. Validate your tags: Use the UET Tag Helper to confirm that the variable revenue and custom events are being fired from your conversion page.

See more videos...