Created on 15 April, 2019 | Updated on 18 September, 2021
Add Bing Conversion Tracking To Shopify

Add Microsoft Ads Conversion Tracking To Shopify

A step by step guide on how to add Microsoft Ads conversion tracking code to your Shopify shop.

Getting Your Code

Log in to Microsoft Ads and navigate to Tools > UET Tag

Now click on Create UET Tag

Add the UET tag name and save

Now download the UET Tag for use in a later step and close the popup message

From the top hand, menu click on Tools > Conversion Goals then on Create Conversion Goal

Enter a Goal Name and choose Destination, then click on Next

  • In the Destination URL, choose regular expression with the value .*thank_you
  • Goal cateogry, choose Purchase
  • Scope, select your account
  • In the Revenue value choose: Conversion action value may vary (for example, by purchase price)
  • In the Count section choose: All (for example, if one ad click leads to three purchases, that will count as three conversions.)
  • Conversion window, can stay as 30 days
  • View through conversion window, can stay as 1 day
  • Make sure the checkbox is enabled for include in Conversions
  • Assign it to the UET Tag that you created. In this example it is Shopify (added by feedarmy)
  • Click on Save

Adding The Code

Log in to Shopify and go to Settings > Checkout

Scroll down till you see Order Processing and in this section Additional Scripts

Now paste on the first line the code below in the Additional scripts sections

{% if first_time_accessed %}

Now open the downloaded UET Tag, you will see two lines of basic text and the last line with the script. Copy the script and paste it underneath the code above. Now add the conversion value script below.

If you are using prices like 1,000.00

<script>
   window.uetq = window.uetq || []; 
   window.uetq.push({ 'gv': {{ checkout.total_price | money_without_currency | remove:',' }}, 'gc': '{{ shop.currency }}' }); 
</script>

If you are using prices like 1.000,00 (Europe)

<script>
   window.uetq = window.uetq || []; 
   window.uetq.push({ 'gv': {{ checkout.total_price | money_without_currency | remove:'.' | replace: ',', '.' }}, 'gc': '{{ shop.currency }}' }); 
</script>

Paste the final code below

{% endif %}

You should see a complete code looking similar to the below.

{% if first_time_accessed %}
<script>(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"12345678"};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>
<script>
   window.uetq = window.uetq || []; 
   window.uetq.push({ 'gv': {{ checkout.total_price | money_without_currency | remove:',' }}, 'gc': '{{ shop.currency }}' }); 
</script>
{% endif %}

You can now click on save.

Need Help?
Do You have a question or need specialist support? Get in touch!

3 thoughts on “Add Microsoft Ads Conversion Tracking To Shopify”

  1. For the life of me I can’t get the Bing Ads conversion tag to fire. I also have my Google Ad conversion pixel on the same thank you page. Could this prevent it from firing?

  2. This is epic. I see the screen shots are old, but hoping the rest of the info is still up to date? If this may be too old to work this way now please post the change, but thank you for making this easy, the Bing docs on this are very hard to understand somehow.

    I’m trying to also install this code in Recharge, but I’m getting an error regarding the second piece of code:

    the error is: https://uploads.disquscdn.com/images/0271898953558564eb23e227a6e82ad88e1bb6474df72d606d20475fef9edf01.png

    Let me know what you think. I’ve contacted recharge customer service as well but they can be very slow and sometimes opt to not answer the question as “out of scope” for them.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.