فهرست منبع

feat(analytics): add support for Microsoft Clarity

Documentation: https://wowchemy.com/docs/guide/analytics/

See #1938
Closes #1923
Vaidic Joshi 4 سال پیش
والد
کامیت
49515d9e14
2فایلهای تغییر یافته به همراه10 افزوده شده و 0 حذف شده
  1. 9 0
      wowchemy/layouts/partials/marketing/microsoft_clarity.html
  2. 1 0
      wowchemy/layouts/partials/site_head.html

+ 9 - 0
wowchemy/layouts/partials/marketing/microsoft_clarity.html

@@ -0,0 +1,9 @@
+{{ if (in (slice (getenv "HUGO_ENV") hugo.Environment) "production") | and site.Params.marketing.microsoft_clarity }}
+<script>
+  (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", '{{site.Params.marketing.microsoft_clarity}}');
+</script>
+{{ end }}

+ 1 - 0
wowchemy/layouts/partials/site_head.html

@@ -158,6 +158,7 @@
 
   {{ partial "marketing/google_analytics" . }}
   {{ partial "marketing/google_tag_manager" . }}
+  {{ partial "marketing/microsoft_clarity" . }}
 
   {{/* Netlify Identity integration. */}}
   {{ if .IsHome | and (site.Params.cms.netlify_cms | default false) }}