How to Add Microsoft Clarity to Hugo Sites via Cloudflare Zaraz Without Redeploying
Developers running Hugo static sites on Cloudflare Pages can integrate Microsoft Clarity analytics through Cloudflare Zaraz, avoiding the need to modify templates or trigger a new build. Zaraz acts as a third-party tag management layer, injecting the Clarity tracking script at the network level rather than embedding it in the Hugo repository. Since Clarity may not appear as a native tool in the Zaraz catalog, it must be added manually using the Custom HTML option with the exact tracking code generated from the Clarity project dashboard. A built-in Pageview trigger is used to fire the script on page load, with SPA support left disabled for standard Hugo sites. Users are cautioned to assign the tool to a consent purpose within Zaraz Consent Management, as unassigned tools may run before a visitor has made a consent choice.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in