MS clarity script installation not working

MS clarity script installation not working

sc08
Visitor
1 0 1

Hi everyone,

I had installed MS clarity on my website a 2-3 months back and the data was showing on the clarity dashboard then.However recently i.e 2 weeks back when i logged on to clarity again, it's showing that the project doesnt exist. 

I pasted the script on shopify again to re-install but its not working. I have tried multiple times now but adding the code on shopify is not completing the installation for some reason and its asking me to install the code again. 

Not sure how to resolve this. 

If anyone has faced a similar issue & if you could please suggest a solution.

Thanks!

Reply 1 (1)

goldi07
Navigator
374 41 67

Hello @sc08 This sounds like a Microsoft Clarity account or tracking issue rather than a Shopify implementation problem, especially since it was working before. Let’s troubleshoot step by step.

 

 

Step 1: Verify Your Clarity Project Still Exists
. Go to https://clarity.microsoft.com/

. Log in and check if:

. Your old project still exists (same domain).

. If not, Clarity may have auto-deleted the project due to inactivity or domain change. You may need to create a new project.

If you're seeing "project doesn’t exist" and it's not in your dashboard, it's been removed or deleted — either by accident or due to policy. Clarity doesn’t send alerts before deletion, especially for inactive projects.

 

 

Step 2: Create a New Project (if necessary)
If the old one is missing:

. Go to Clarity Dashboard → "Add New Project"

. Enter your exact store domain (e.g., https://yourstore.myshopify.com or https://yourcustomdomain.com)

. It will generate a new tracking script — make sure to copy the new one.

 

 

Step 3: Install the Script Properly in Shopify
Paste the updated script in your theme.liquid file, just before </head>:

1. In Shopify Admin → Online Store > Themes

2. Click “Edit code” for your live theme

3. Open layout/theme.liquid

4. Scroll to the bottom of the <head> section

5. Paste the Clarity script just above </head>

6. Click Save


Example:

<!-- Microsoft Clarity Tracking Code -->
<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", "YOUR_PROJECT_ID");
</script>

Replace YOUR_PROJECT_ID with your actual ID.

 

 

 

Step 4: Confirm Installation
After saving:

. Go back to Clarity Dashboard

. Click “Check Installation”

. Visit your store in a new incognito browser window

. Wait a few minutes and refresh the Clarity dashboard

 

Still Not Working?
If it's still asking to "install code again", check:

. Theme cache: Try hard refreshing (Ctrl+Shift+R) the storefront

. Correct domain: Clarity project domain must match the live domain (e.g., www.domain.com vs domain.com)

. Theme switch: Did you switch themes recently? Clarity must be installed in the active theme

. Script blocked: Are any ad blockers or browser settings blocking the Clarity script?

 

Final Tip:
If the old project is unrecoverable, use the new project and wait ~2–4 hours for initial data to populate. You can also check for JS errors in the browser console.

 

 

Thank you  😊

Was I helpful?

Buy me a coffee


APPS BY US :

Professional Customer Accounts APP


Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -Goldi184507@gmail.com - Skype: live:.cid.819bad8ddb52736c -Whatsapp: +919317950519
Checkout Some Free Sections Here