Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am trying to install Microsoft Clarity, but the Shopify tech team took out the box to put the script in. Customer service is unable to modify the code to work. Does anyone know how to fix this?
<script type="text/javascript"> (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "od5gfv1des"); </script>
Solved! Go to the solution
This is an accepted solution.
Hi,
Need to add Clarity script at theme.liquid
It should look like this (paste the code just before </head>)
...
<script type="text/javascript">
(function(c,l,a,r,i,t,y) {
w[c]=w[c]||function(){
(w[c].q=w[c].q||[]).push(arguments)},w[c].l=1*new Date();
t=l.createElement(a),y=l.getElementsByTagName(a)[0];
t.src=r;y.parentNode.insertBefore(t,y)
})(window,"Clarity","script","https://www.clarity.ms/tag/YOUR_TRACKING_CODE");
</script>
</head>
This is an accepted solution.
Hi,
Need to add Clarity script at theme.liquid
It should look like this (paste the code just before </head>)
...
<script type="text/javascript">
(function(c,l,a,r,i,t,y) {
w[c]=w[c]||function(){
(w[c].q=w[c].q||[]).push(arguments)},w[c].l=1*new Date();
t=l.createElement(a),y=l.getElementsByTagName(a)[0];
t.src=r;y.parentNode.insertBefore(t,y)
})(window,"Clarity","script","https://www.clarity.ms/tag/YOUR_TRACKING_CODE");
</script>
</head>
Thank you!
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025