How to Set Up Microsoft Ads (Bing) Dynamic Remarketing on Shopify
With Microsoft Advertising You Can Use Dynamic Remarketing
Dynamic Remarketing is available for those who want to run Microsoft ad campaigns. Dynamic remarketing on Microsoft Ads is an effective tool for promoting an online store. However, setting up all the necessary parameters for dynamic remarketing isn’t easy and requires some less obvious additional settings.
Our article will help you set up everything you need for your online store on Shopify so you can work with dynamic remarketing on Microsoft Shopping Ads (Bing Shopping Ads).
The data is tracked and transferred using additional scripts. Our instruction also contains a modified version of the Microsoft Ads (Bing) Purchase Goal Tag for sending transaction value data.
Let’s set up Microsoft Dynamic Remarketing step-by-step.
Contents
1. Create a Dynamic Remarketing Audience in Microsoft Ads Account
2. Put Bing UET Dynamic Remarketing Audiences Tag to All Shopify Pages
3. Put the Microsoft UET Dynamic Remarketing Tag on the Shopify Cart Page
3.1. Set Up a UET Purchase Conversion With Dynamic Value Tracking for Bing Shopping
4. Put the Microsoft Ads Dynamic Remarketing Tag on the Shopping Cart Page
5. How to Check & Track UET Tags Using Bing Tag Assistant?
6. How to Find Out What Product ID Format Is Used in Your Microsoft Product Feed
7. FAQ
Create a Dynamic Remarketing Audience in Microsoft Ads Account
The first step is to create a dynamic remarketing audience in the audience section in your Microsoft Ads account. Go to the “Audience” menu and find the “Create audience” button.

Add the audience name and select the type of audience you want to create: Dynamic remarketing list.

From the “Tag name” drop-down menu, select the tag you want.

Select one of the 5 available dynamic audience types:
- General visitors — “home”, “category” and “other” pages visitors;
- Product searchers — “search results” pages visitors;
- Product viewers — “product” page visitors;
- Shopping cart abandoners — “cart” page visitors;
- Past buyers — “purchase” page visitors — your thankyou page visitors.
Past buyers’ audiences will be excluded from other audiences automatically.
Don’t forget to include the time frame for the audience: 1 to 180 days.
You will see the UET tag for placing on the site in a separate window, at the end of the page.

This code includes 3 parts:
- Main Microsoft UET tag. This part contains the unique ID of your UET tag.
- This code part sends additional parameters. It needs to be personalized.
- UET tag comment: the optional part of the code. You don’t have to implement it on the site. But if you choose not to use it, don’t forget the closing tag </script> — the code won’t work without it.
The first part of the code can be used without changes.
The second part has to be modified.
window.uetq = window.uetq || [];
window.uetq.push('event', '',
{'ecomm_prodid': {% if template contains 'product' -%}
'shopify_US_{{ product.id }}_{{ product.selected_or_first_available_variant.id }}'
{%- elsif template contains 'collection' -%}
[{% for item in collection.products limit:3 %}'shopify_US_{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
{%- elsif template contains 'index' -%}
[{% for item in collection.products limit:3 %}'shopify_US_{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
{%- elsif template contains 'search' -%}
[{% for item in search.results limit:3 %}'shopify_US_{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
{%- elsif template contains 'cart' -%}
[{%- for item in cart.items limit:3 -%}'shopify_US_{{ item.product_id }}_{{ item.variant_id }}'
{%- unless forloop.last -%}, {%- endunless -%}
{%- endfor -%}]{%- endif -%},
'ecomm_pagetype': '{% if template contains 'index' %}home{% elsif template contains 'collection' %}category{% elsif template contains 'search' %}searchresults{% elsif template contains 'product' %}product{% elsif template contains 'cart' %}cart{% elsif template contains 'purchase' %}purchase{%endif %}', });
This code will pass dynamic product IDs and website page types to the ecomm_prodid and ecomm_pagetype attributes. This code is set to transfer Product IDs in shopify_US_xxxxxxxxxxxxxxx format.
There are three other variants of the size:
- SKU — the SKU code value (combines letters and numbers, e.g. aga-012) is sent instead of the product ID;
- variant-id — a unique identifier of the product variant (numeric number, for example, 21283160948841);
- product-id_variant-id — unique identifier of the product and product variant (two numbers with an underscore, for instance, 28541777444969_21283160948841).
The last option is rarely used, usually, a prefix is added to the numbers, such as — shopify_US — in our case. “US” is an alphabetic code of the country of the feed.
If you have a Product ID in the SKU format in your feed, replace the lines of code highlighted in yellow above with:
'{{ product-id-prefix }}{{ product.selected_or_first_available_variant.sku }}'
[{% for item in collection.products limit:4 %}'{{ product-id-prefix }}{{ item.selected_or_first_available_variant.sku }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in collection.products limit:4 %}'{{ product-id-prefix }}{{ item.selected_or_first_available_variant.sku }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in search.results limit:4 %}'{{ product-id-prefix }}{{ item.selected_or_first_available_variant.sku }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{%- for item in cart.items limit:4 -%}'{{ product-id-prefix }}{{ item.sku }}'
If you have a Product ID in the variant_id format in your feed, replace the lines of code highlighted in yellow above with:
'{{ product-id-prefix }}{{ product.selected_or_first_available_variant.id }}'
[{% for item in collection.products limit:4 %}'{{ product-id-prefix }}{{ item.variants.first.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in collection.products limit:4 %}'{{ product-id-prefix }}{{ item.variants.first.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in search.results limit:4 %}'{{ product-id-prefix }}{{ item.variants.first.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{%- for item in cart.items limit:4 -%}'{{ product-id-prefix }}{{ item.variant_id }}'
If you have a Product ID in the product-id_variant-id format in your feed, replace the lines of code highlighted in yellow above with:
'{{ product-id-prefix }}{{ product.id }}_{{ product.selected_or_first_available_variant.id }}'
[{% for item in collection.products limit:3 %}'{{ product-id-prefix }}{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in collection.products limit:3 %}'{{ product-id-prefix }}{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{% for item in search.results limit:3 %}'{{ product-id-prefix }}{{ item.id }}_{{ item.selected_or_first_available_variant.id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
[{%- for item in cart.items limit:3 -%}'{{ product-id-prefix }}{{ item.product_id }}_{{ item.variant_id }}'
If you are unsure which Product ID you need, check out the last section of this guide.

If not, drop us a message and let’s change that with our Microsoft Ads management!
Put Bing UET Dynamic Remarketing Audiences Tag to All Shopify Pages
Go to your Shopify account.
In the left menu select “Online Store”, then go to the “Themes” section (1). In the drop-down “Actions” menu (2), select “Edit code” (3).

In the “Layout” folder find the snippet named theme.liquid and open it.

Put the code of the UET tag in the theme.liquid window. Place the second personalized part of the code between the <head> and </head> tags. Save your changes.
Put the Microsoft UET Dynamic Remarketing Tag on the Shopify Cart Page
Before going on with the instructions on Microsoft Dynamic Remarketing tag placing in the cart, you should also know about setting up a purchase conversion and placing the tag in the cart. If you’ve already set up a purchase conversion with dynamic value tracking, skip this and go to the next step.
Set Up a UET Purchase Conversion With Dynamic Value Tracking for Bing Shopping
Follow the next steps:
1. Set up the conversion goal on the Microsoft Ads account, in the “Conversion goals” section.

2. Fill in the conversion name field and select the conversion type: Event.

3. Fill in the Action field and select Goal Category: Purchase.

4. Select “Conversion action value may vary…” and fill in the default value.

5. Select how you prefer to count conversions: all or unique. Correct the conversion window if you need.
6. At the end of the page, you will see the UET tag script code. This code needs to be refined and placed in the Shopify shopping cart.

- The main UET tag. It contains a unique ID of your UET tag.
- The part of the code that tracks info about the purchase with dynamic parameters value. You need to replace this part with the code below:
window.uetq = window.uetq || [];
window.uetq.push('event', 'purchase',
{'revenue_value': {% if price-decimal-fs == true -%}{{ checkout.total_price | money_without_currency | remove: ',' }}{% else %}{{ checkout.total_price | money_without_currency | remove: '.' | replace: ',', '.' }}{%- endif -%},
'currency': 'USD'});
</script>
This tag contains the event name set in the Action field in Step 3 of the conversion creation:
(window.uetq.push('event', 'purchase')
The conversion value and currency are also dynamically transferred. If you use a different currency on your website, replace the USD value with the letter code of the desired currency.
Place a UET tag in your Shopify Shopping cart: go to the Settings section (1) and select Checkout (2).

Place the tag in the Additional scripts section.
The final UET tag in the Shopify cart that tracks purchase events and values will look like this:
<script>
(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"56290063"};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.uetq.push('event', 'purchase',
{'revenue_value': {% if price-decimal-fs == true -%}{{ checkout.total_price | money_without_currency | remove: ',' }}{% else %}{{ checkout.total_price | money_without_currency | remove: '.' | replace: ',', '.' }}{%- endif -%},
'currency': 'USD'});
</script>
Put the Microsoft Ads Dynamic Remarketing Tag on the Shopping Cart Page
Place the tag below under the conversion tag from the previous step. This tag tracks and sends dynamic remarketing parameters:
<!-- Event snippet for Bing Dynamic Remarketing -->
<script>
window.uetq.push('event', '', {
'ecomm_prodid': [{% for item in checkout.line_items limit:3 %}'shopify_US_{{ item.product_id }}_{{ item.variant_id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}],
'ecomm_pagetype': 'purchase'});
</script>
The correct code for your Product ID format, if you need:
1. If you have the SKU Product ID format, replace the lines of code highlighted in yellow above with:
[{% for item in checkout.line_items %}'{{ product-id-prefix }}{{ item.sku }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
2. If you have the variant_id Product ID format, replace the lines of code highlighted in yellow above with:
[{% for item in checkout.line_items %}'{{ product-id-prefix }}{{ item.variant_id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
3. If you have the product-id_variant-id Product ID format, replace the lines of code highlighted in yellow above with:
[{% for item in checkout.line_items limit:3 %}'{{ product-id-prefix }}{{ item.product_id }}_{{ item.variant_id }}'{% unless forloop.last %}, {% endunless %}{% endfor %}]
Save changes.
The final full tag in the Shopify shopping cart:

- The main UET tag. It contains a unique ID of your UET tag.
- Part of the code that tracks the info about the purchase with the dynamic parameter’s value.
- The code that passes values for the dynamic remarketing parameters: Product ID and page type.
How to Check & Track UET Tags Using Bing Tag Assistant?
If the UET tag code is implemented correctly, your UET tag will get an active status in the UET tag section of Microsoft Ads.

If the dynamic remarketing parameters are tracked correctly, the dynamic remarketing audiences will begin to accumulate data.

It’s important to note that the statistics on the number of users within audiences can take a long time to accumulate. It depends on the volume of traffic to each audience. It is especially true for the “Abandoned Cart” and “Past Buyers” audiences. While the statistics are accumulating, the size value of these audiences will be 0. In our case, the statistics for these audiences started to display after 30 users in the search network audience only.
Install the UET Tag Helper browser extension to check if Product ID and Page type values are passed to the dynamic remarketing attributes correctly.
Launch the extension, open your website and activate the extension on the website. In the Tracking Code section, check out the parameters that are replaced dynamically.

To check whether the tags are triggered on your “Thank you page” after the purchase, go to the Order section in your Shopify account. Select an order and click on it.

On the Order page find the More actions bar (1) and select the View order status page (2).

A new window will open the thank you page for this order. On that page, press Ctrl+U and find the UET tag code. The easiest way to do this is to search for the unique identifier of your UET tag.

If your code works correctly, you will see the correctly replaced values for Product ID and Page type. Also, the revenue value will be replaced correctly.
You can also contact us for professional Bing Shopping management if you have any problems setting up ad campaigns or dynamic remarketing.
How to Find Out What Product ID Format Is Used in Your Microsoft Product Feed
The Product ID format is often set at the level of the application that creates the product feed on Shopify.
If you use Feed for the Google Shopping application (recommended), you may check the Product ID there.
In the application, find Settings and select Bing Shopping Settings. Here you can find the Product ID format of your feed.

Now you know how to set up dynamic remarketing. Don’t hesitate to ask your questions in the comment section, we’ll be happy to answer them!
Visit our eCommerce PPC library and find more valuable guides and our cases.
If you want us to help you with the setup, feel free to contact us.
To find out more about setting up Microsoft Shopping Campaigns (Bing Ads) for e-commerce stores on Shopify, read our article on Bing Shopping Ads.
FAQ
How to set up Bing Ads?
Sellers can easily and quickly start running ads on Bing Ads. After making a free account, the next step is to create a campaign. You can also import your campaign if you have one on Google Ads or Facebook Ads. Before your ads go live, you need to enter payment information. There are 2 options available: postpay and prepay.
If you are going to advertise your online store, you will need to create a Store on Microsoft Merchant Center and set up the correct product feed.
How do I advertise on Bing with Shopify?
The first step you need to do is to import your Shopify store product list into the product feed for Microsoft Merchant Center. There are many different ways to do this. One of them is to use the Simprosys Google Shopping Feed App extension. It will allow you to easily manage and integrate the feed into Microsoft Merchant Center (Google & Facebook integration is also supported).
If your product feed is correct and meets all Microsoft requirements, you can set up a Shopping campaign (Standard or Smart) on your Microsoft (Bing) Ads account.
How do I set up conversion tracking in Bing Ads?
To set up conversion tracking in Bing Ads, you need to create a Universal Event Tracking tag in your Bing Ads account and add it to the Shopify account. If you need help, feel free to contact our team.
How do I view conversions in Microsoft Ads?
You can view conversions in 3 places: conversion goals page, campaigns and reports.
What are the benefits of Dynamic Remarketing for Shopping Ads?
Correctly configured dynamic remarketing allows you to more accurately show product ads to exactly those users they’re relevant to. With dynamic remarketing, you can interact more accurately with users, prompting them to return to an abandoned cart and complete a purchase, or reminding them of items they recently viewed. If it’s relevant to your business, you can remind users who’ve previously purchased your products to make a purchase again.
How many types of Dynamic Remarketing lists are available to an advertiser on Bing?
Currently, 5 types are available. They are:
- general visitors (people who visited the website),
- product searchers (people who searched for certain products on the website),
- product viewers (people who checked the products),
- shopping cart abandoners (people who added a product or products to their cart but didn’t complete checkout),
- past buyers (clients who already bought something before).
Are there Shopify Applications that can help integrate Dynamic Remarketing parameters?
Yes. For example, the Simprosys app can also transfer conversions and dynamic remarketing parameters to Microsoft.

Xenia Volokitina
Performance Marketing Specialist working with PPC since 2016. Specializes in Google & Microsoft paid traffic for eCommerce & B2B projects. In love with analysis. When not launching effective ad campaigns, she is reading about the latest eCommerce and data tracking trends.