You can integrate Bing Ads Conversion Tracking into your online store to help you understand more about customer behavior and the traffic source. Once it's added to your website, the UET tag tracking code allows Microsoft Advertising to collect actions that people take so you can track conversions or target audiences with remarketing lists.

On this page:
A. Get your Bing Ads Conversion Tracking
B. Install the Bing Ads Conversion Tracking


A. Get your Bing Ads Conversion Tracking

Log into your Bing Ads account, go to Campaign in the left column.

At the top of the screen, click Tools > UET tag.



Create one UET tag then press Save.

UET tag name should be in this format: Ads 1, Ads 2,... to avoid misunderstanding with tracking events.



At the top of the screen, click Tools > Conversion goals . Hit the button Create conversion goal and follow this guideline to create a new conversion goal.

After successfully create your new conversion goal, back to Conversion Goal dashboard on Bing Ads, copy Tag ID corresponding with that new conversion goal.



B. Install Bing Ads Conversion Tracking on ShopBase store

On your store admin, go to Online Store > Preferences

Scroll to the Additional scripts > Head section and paste this scripts.

<script>
(function(w,d,t,r,u){
var f,n,i;w[u]=w[u]||[],f=function(){
var o={ti:"17490171"}; //insert your bingId in 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");
window.uetq = window.uetq || [];
window.sbsdk.ready(function() {
window.sbsdk.cart.onAdd(function(payload) {
let cart = window.sbsdk.cart.get()
let product_added = cart.items.find(item => item.variant_id == payload.variant_id)
window.uetq.push('event', 'add_to_cart', {
value: product_added.price,
items: [
{
quanity:product_added.qty,
product_id: product_added.variant_id,
}
],
currency: cart.currency,
});
});
let bingTracked = false;
window.sbsdk.page.onContextUpdate(function(context) {
if(context.type !== 'process_checkout') {
bingTracked = false;
}
window.addEventListener('load', function () {
bingInited = false
})
if(!bingInited) {
window.uetq.push('event','page_view',{ page_path: '/' + context.type});
}
if(context.type === 'process_checkout' || context.type ==='checkout') {
if(!bingTracked) {
let cart = window.sbsdk.cart.get()
let cartItem = cart.items.map(function(item) {
return item = {
'id': item.product_id,
'quantity': item.qty,
'item_price': item.total_line_with_discount_price,
}
})
window.uetq.push('event', 'begin_checkout',{ page_path: '/checkout/' },
{
items: JSON.stringify(cartItem),
currency: cart.currency,
value: String(cart.subtotal_price),
});
bingTracked = true
}
}
switch (context.type) {
case 'home':
// push event tracking pinterest at home page
break;
case 'cart':
break;
case 'product':
window.uetq.push('event', 'view_product', { page_path: '/products' });
break;
case 'collection':
break
case 'collections':
break;
case 'process_checkout':
break;
case 'post_checkout':
// Inject code tracking at thank you page here
let order = window.sbsdk.checkout.getOrder()
let collection_titles = []
if(order.items.length > 0 ) {
for(let x in order.items) {
let collections = order.items[x].collections
for(let y in collections) {
collection_titles[y] = collections[y].title
}
}
let line_items = order.items.map(function(item) {
return item = {
'product_category': collection_titles,
'product_name': item.product_title,
'product_id': item.product_id,
'product_quantity': item.qty,
'product_price': item.item_price,
}
})
let qtyBlock = document.getElementsByClassName('checkout-product-thumbnail__quantity');
let qty = 0
for (let i = 0; i < qtyBlock.length; ++i) {
qty += parseInt(qtyBlock[i].innerHTML)
}
let totalPrice = document.getElementsByClassName('payment-due__price')[0].innerHTML
totalPrice = totalPrice.substring(1)
totalPrice = totalPrice.substring(0, totalPrice.length - 3)

window.uetq.push('event', 'purchase', {
order_id: order.id,
value: totalPrice,
order_quantity: qty,
currency: window.sbsdk.cart.get().currency,
line_items: line_items
});
}
break;
default:
break;
};
});
});

</script>


Replace 17490171 in Line 4 with your Bing Ads Conversion Tracking



Press Save and you are done.

After adding Bing Ads conversion tracking into ShopBase, you must create create an Ad campaign in your Bing Ads account by following this article then you're ready to receive precise data about your customers on your store.

Related articles:
How to install the Pinterest Tag on ShopBase
How to install Twitter conversion tracking ID on ShopBase
Was this article helpful?
Cancel
Thank you!