Multi-platform: Set up customer action tracking

We can tell you what potential customers do after they click your ad, including the pages they visit on your website, how long they spend there, and more!
Note

Not everyone has this feature yet. If you don't, don't worry—it's coming soon!

Once you have a campaign up and running, what does your audience do when they get to your website? Set up customer action tracking to learn:

  • How many people visit your website.
  • How long they spend there.
  • Whether or not they're visiting the pages that are most important to your business.

The last point is key, because your website is tailored to your own business goals. Is your goal to sell products, raise brand awareness, generate leads, drive foot traffic to your physical location, or something else? Customer action tracking can help you make sure that your advertising budget and social engagements are yielding results.

Notes
  • You need to add a payment method before you can set up customer action tracking.
  • For customer action tracking to work, you (or a web developer) will need to add a tracking tag to each page of your website's code.

If customer action tracking has already been setup, then you can view or copy the tracking tag at any time. Select a campaign from the Ads page, go to the Customer action tracking tile, select the ellipsis icon , select View tracking tag, and then select Copy tag. You can add tracking tags directly to your own website or through another website platform.

Set up customer action tracking

  1. Get started:
    1. From the collapsible menu on the left, select All campaigns > Campaign details for the campaign you want to edit.

      If you're using the new Microsoft Advertising navigation, from the navigation menu on the left, hover over Campaigns and select Campaigns > Campaign details for the campaign you want to edit.

    2. In the Customer action tracking pane, select the Start tracking button from the lower-left part of the pane.
    3. On the Manage Goals page, select Add new goal.
  2. Select what type of conversion you want to track:
    1. Select Sales, Leads, or Others.
    2. Choose a specific interaction/event you want to use for tracking that conversion type.
    3. Select Next.
    Learn more about conversion goal categories.
  3. Select how you would like to track:
    1. Select By destination URL or By custom event.
    2. Select Next.
    Learn more about conversion goal types.
  4. Set up your conversion goal:
    1. Enter a name for your goal and set the custom event parameters.
    2. Select Next.
  5. Measure the value for each conversion:
    1. Select Each conversion action has the same value or Conversion action value may vary and enter the value of the conversion.

      Note

      If you select Conversion action value may vary, the revenue value will change based on the customization you make to the UET tag tracking code. Learn more about reporting variable revenue with UET.

      Important

      If you select No value, you do not have the option to enter a conversion value. We don't recommend this.

    2. Select Next.
  6. Edit your website: For customer action tracking to work, someone will need to add a tracking tag to each page of your website's code. You have three options here:
    1. If you built your website using WordPress.com, Wix, Shopify, or BigCommerce (and want to use it to edit your website's code), select Let me add the tracking tag through a website editing platform and then select Next.
    2. If you're comfortable making updates directly to your website's code, select Let me edit my website's code myself and then select Next.
    3. If someone else usually updates your website's code for you, select Let me send the tracking tag to someone else and then select Next. In the next step, enter the appropriate email address or addresses, select Send, and then Next.

Add the tracking tag to your website directly

To set up customer action tracking for Microsoft Advertising, you need to add a tracking tag to the code for every page of your website.

  1. Copy your tracking tag from Microsoft Advertising as described earlier in this article.
  2. Open the HTML for each webpage of your website.
  3. Paste the tracking tag anywhere in the head section of your website's code (before the closing head tag: </head>).
  4. Save the changes to your webpages.

Set up a custom event tag on your website

An event tag is also required to track custom events or variable revenue.

  1. Select when you want to track this event:
    • Track event on inline action (e.g., button click, form submission)
    • Track event on page load (e.g., when the page loads, refresh page)
  2. Copy the event tag script and follow the instructions to paste it in between the opening head and closing head tags of your website code (right after the base tag).

    Note:The base tag should be pasted on every page of your website, but the event tag is only needed on the page that has the action you want to track. See the example shown in the Event tag installation step of the set-up.

Note

When you select Track event on inline action or when tracking variable revenue, you might need to edit the code example based on what you've selected elsewhere.

Using UET tags with single-page application (SPA) websites

Although common, single-page application (SPA) websites are challenging to track. With SPAs, content is dynamically loaded without a typical navigation event occurring. In a sense, the page is only loaded once. However, from an analytics and goal-tracking standpoint, it is necessary to treat each separate navigation as a new page load.

Learn what you need to do to enable UET tags in SPAs expando image

SPA websites are required to use the JavaScript UET tag tracking code. SPA events are triggered using the same syntax as with custom events, with the action 'page_view' and at a required 'page_path' parameter ('page_title' is optional). The parameter 'page_path' must start with a '/'. Example:

window.uetq = window.uetq || []; 
window.uetq.push('event', 'page_view', { 'page_path': '/spa_page' });
Note

If you're sending page_view events, you need to make sure you don't have any custom event conversion goals or remarketing lists that have their "event action" parameter set to "page_view".

Here are three different ways of triggering SPA events. Note that we recommend using the first way. For each option, we have a sample webpage that you can visit to see the appropriate code in action.

  • Content change: Trigger an SPA event any time your application loads dynamic content. In this case, the real URL is automatically sent in a standard pageLoad event on the first load. You can use this URL in your destination goals, and any custom events triggered on that first page will be associated with it. Each SPA event will generate a pageLoad event with the SPA URL, which is not required to be a loadable path. You can reference these URLs in your goals as well. Any custom events triggered after an SPA event will only be associated with the SPA pageLoad (in other words, not the original URL).
  • All pages: Trigger an SPA event on all pages, including the initial load. This scenario is the same as the preceding one, except the auto pageLoad event is not used. Because it still triggers, it is important to order your events so that the SPA event triggers before any other custom events. If they trigger out of order, some or all may be associated with the auto pageLoad event (and original URL), instead of the SPA pageLoad event (and SPA URL including page_path).
  • All pages, auto-disabled: Trigger an SPA event on all pages and additionally disable the auto page load. This is accomplished by adding 'disableAutoPageView: true' to the initialization parameters (Note: Do not modify the snippet code directly to disable). This is the same as the previous scenario but removes the requirement that the SPA event must be triggered first on the initial page load. However, subsequent SPA events are still required to be triggered before any custom events that are associated with them (or they will be attributed to the previous SPA event).

Add your tracking tag to your webpages using BigCommerce

If you built your website on BigCommerce, follow the steps below to set up your Microsoft Advertising customer action tracking tag.

Note

Please refer to BigCommerce Support for more information. Microsoft Advertising is not responsible for BigCommerce's processes or documentation, nor for changes made to BigCommerce's processes or documentation.

  1. Copy your tracking tag from Microsoft Advertising as described earlier in this article.
  2. Sign in to your BigCommerce account.
  3. From your BigCommerce dashboard, go to Storefront > Footer Scripts.
  4. Paste your Microsoft Advertising tracking tag into the script box and select Save.

Add your tracking tag to your webpages using Shopify

If you built your website on Shopify, follow the steps below to set up your Microsoft Advertising customer action tracking tag.

Note

Please refer to the Shopify Help Center for more information. Microsoft Advertising is not responsible for Shopify's processes or documentation, nor for changes made to Shopify's processes or documentation.

  1. Copy your tracking tag from Microsoft Advertising as described earlier in this article.
  2. Sign in to your Shopify account.
  3. In Shopify, select Online store > Themes.
  4. Find the theme you're currently using and then select the Ellipsis > Edit code to access your website's code.
  5. Under Layout, select theme.liquid and scroll down to the end of your website's code.
  6. Paste your Microsoft Advertising tracking tag above the "</body>" HTML tag and select Save.
  7. Go to Settings > Checkout to add your Microsoft Advertising tracking tag to your site's checkout page.
  8. Paste your Microsoft Advertising tracking tag in the Order Processing > Additional scripts text box and select Save.

Add your tracking tag to your webpages using Squarespace

If you built your website on Squarespace, follow the steps below to set up your Microsoft Advertising customer action tracking tag.

Note

Please refer to the Squarespace Help Center for more information. Microsoft Advertising is not responsible for Squarespace's processes or documentation, nor for changes made to Squarespace's processes or documentation.

  1. Copy your tracking tag from Microsoft Advertising as described earlier in this article.
  2. Sign in to your Squarespace account and select the webage you would like to track conversions for.
  3. Install the tracking tag.
    1. Select Settings.
    2. Select Advanced.
    3. Select Code Injection.
    4. Paste the tracking tag in the HEADER section.
    5. Select Save.

Add your tracking tag to your webpages using Wix

If you built your website on Wix, follow the steps below to set up your Microsoft Advertising customer action tracking tag.

Note

Please refer to the Wix Help Center for more information. Microsoft Advertising is not responsible for Wix's processes or documentation, nor for changes made to Wix's processes or documentation.

  1. Copy your tracking tag from Microsoft Advertising as described earlier in this article.
  2. Log into your Wix dashboard and select Settings from the left menu.
  3. Scroll to the Advanced bar at the bottom of the page and select Custom code.
  4. Select + Add Custom Code from the upper-right corner of the page.
  5. In the text box under Paste code snippet here, paste the tracking code that you copied in Step 1.
  6. Enter a name for your code in the Name box that you can easily identify later.
  7. Under Add Code to Pages, select an option.
    • All pages adds the code to every page of your website, including any new pages that you create in the future.
      • Select Load code once if you want the code to load once per visit to your website.
      • (Recommended) Select Load code on each new page if you want the code to load each time a page is visited.
    • Choose specific pages adds the code to only the pages you choose. Use the dropdown menu to select the specific pages you want to add the code to.
  8. Under Place Code in, select the area of your website where you want to place the code (Head, Body - start, or Body - end).
  9. Select Apply.

See more videos...