You need to be able to edit your website's code in order to add your UET tag tracking code. If you're not sure how to edit your website's code, contact your webmaster.
After you create a UET tag, the next step is to add the UET tag tracking code to your website. We recommend that you, or your webmaster, add it to every page of your website in the head or body section.
You have a few options when working with UET tags. You can either add the UET tag tracking code directly into your website's code using JavaScript or use a third-party tag manager. Additionally, if your website was built on a website platform (such as Shopify or WordPress), you can use that system to add your UET tag.
You can add the UET tag tracking code anywhere in your webpage's head section (before the closing head tag: "</head>") or body section (before the closing body tag: "</body>").
From the top menu, select Tools > UET tag.
If you're using the new Microsoft Advertising navigation, from the navigation menu on the left, hover over Conversions and select UET tag.
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.
UET works with all major tag management systems. Here is the current list of (and links to instructions for) tested and supported tag managers:
UET is designed to work with all major website platforms. Here is the current list of (and links to instructions for) tested and supported platforms that allow you to install UET tags:
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.
SPA websites are required to use the JavaScript UET tag tracking code. If you recently added your UET tracking code, it might already be enabled for SPA tracking by default. To verify, you can check whether your tag snippet has the following bolded text or not:
<script>
(function(w,d,t,r,u) {var f,n,i;w[u]=w[u]||[] ,f=function(){var o={ti:"TAG_ID_HERE", enableAutoSpaTracking: true}; 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>
If your tag snippet does not contain the above parameter and you want to make use of auto-SPA tracking, you can go to the Microsoft Advertising UI and get the new event snippet with the above behavior enabled by default. You can then update your website to use the new snippet.
You might want to disable this behavior if you are already tracking SPA pageviews manually. To do so, change the value of the enableAutoSpaTracking parameter in your tag snippet to false. You may also want to disable this if your website does not use browser history state for navigation, although we recommend keeping it turned on if you're not sure.
For legacy instructions on manually tracking SPA pageviews, see below:
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' });
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.