Shopify themes, liquid, logos, and UX
Hi all,
I'm trying to install the Microsoft advertising tracking on shopify, I've followed their guide and added the script to the theme.liquid.
The next step is to add the script to the checkout page, by going to settings > Checkout> Order status page, however we are using the Checkout extensibility, and it does not allow me to add scripts in there.
Can anyone point me in the right direction to track conversions with Microsoft ads?
Hi Kieran,
Let me know if the following is of help, or if you found a working, better solution already, it would be great to hear about it.
In case you or anybody else have not figured it out yet, without any other intermediary like Tag Managers:
With checkout extensibility you can not use the scripts in themes as you used to (now that exclamation raises doubts 😉 but continue reading). I have it running following the official documentation for several clients with Google Tag Manager but I will translate it for using without GTM:
(function(w,d,t,r,u)
{
var f,n,i;
w[u]=w[u]||[],f=function()
{
var o={ti:"<your_bing_ads_id>", 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");
analytics.subscribe("checkout_completed", (event) => {
let checkout = event.data.checkout;
function uet_report_conversion() {
window.uetq = window.uetq || [];
window.uetq.push('event', '', {"event_label":"<optional label value>","event_category":"<category value>","revenue_value":checkout.totalPrice.amount,"currency":checkout.totalPrice.currencyCode});
}
});
How did you configure this with GTM?
I have done this with GTM and enabling a datalayer. The datalayer works fine for every other platforms and the Add to cart and begin checkout tags are also working for Microsoft ads. But the purchase event is not getting any conversion. It shows some events under the UET tag report, but no conversions in conversion goals. I suspect this is an issue with the MSCLICK ID.
So it would help a lot if you can give me a quick walthrough on how you do this with GTM?
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024