JavaScript vs. Non-JavaScript UET tag tracking code

JavaScript vs. Non-JavaScript UET tag tracking code

After you create a UET tag, the next step is to add the UET tag tracking code to your website. Depending on the type of website you have, you can select a JavaScript or Non-JavaScript UET tag tracking code.

Before you can track conversions or target audiences using a remarketing list, you need to create a UET tag in Bing Ads and then add the UET tag tracking code to every page of your website. Bing Ads allows you to select either a JavaScript or Non-JavaScript UET tag tracking code.

JavaScript

This is the recommended tracking code. It allows Bing Ads to collect richer activity data that improves conversion tracking and remarketing in paid search. The only time you shouldn't use this is if your website has rules that prohibit JavaScript from being installed on it.

Here is an example of the JavaScript UET tag tracking code:

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

<noscript>
<img src="//bat.bing.com/action/0?ti=TAG_ID_HERE& Ver=2" height="0" width="0" style="display:none ; visibility: hidden;" />
</noscript>

Note

The JavaScript UET tag tracking code includes a <noscript> section, which is simply a <img> tag that will not be able to do the rich reporting but will ensure that the basic event is not lost when people use a browser that doesn't support JavaScript.

Non-JavaScript

This is the <noscript> section of the JavaScript UET tag tracking code and the only time you should use this is if you have rules prohibiting you from adding JavaScript to your website.

This version doesn't collect rich customer data and you will have to update the code if Bing Ads releases any changes to the UET tag tracking code. You'll also have limited functionality of tracking conversions for custom events or variable revenue.

Here is example of the Non-JavaScript UET tag tracking code:

<noscript>
<img src="//bat.bing.com/action/0?ti=TAG_ID_HERE& Ver=2" height="0" width="0" style="display:none; visibility: hidden;" />
</noscript>

Note

Don't know what UET is? See What is UET and how can it help me?

See more videos...