Analytics: Add Microsoft Clarity Tracking Script to WordPress

Analytics Add Microsoft Clarity Tracking Script To Wordpress Image

Clarity is actually pretty cool. I never end up looking at it or pulling useful info from it. But you COULD!

What it does…

Adds the Microsoft Clarity tracking script to your site. NOTE: You’re gonna wanna add your own unique MS Clarity Project ID in the code, then let this snip take care of the rest.

How it does it…

Adds the tracking JavaScript code to the head of your site using `wp_head`, but only on Production (if using Env555), and only for logged-in users. (But you could edit those parts, if desired.)

Use the JSON file for easily importing into your CodeSnippetsPro plugin. Use the PHP file or just copy/paste the code sample into your functions.php if you’re not using CodeSnippetsPro.

Related Snips

Leave a Reply

Your email address will not be published. Required fields are marked *