Recipes
Each recipe lists the placement and any targeting. Replace the placeholder IDs with your own.
Google Analytics 4
Section titled “Google Analytics 4”Placement: Head · Priority: 10
<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script><script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-XXXXXXXXXX');</script>Google Tag Manager
Section titled “Google Tag Manager”GTM needs two snippets.
1. Loader. Placement: Head · Priority: 5
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>2. No-script fallback. Placement: Body start
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>Search engine verification
Section titled “Search engine verification”Placement: Head · Include paths: /
Verification only needs the home page, so include just /.
<meta name="google-site-verification" content="your-token" /><meta name="msvalidate.01" content="your-token" />Plausible / privacy-friendly analytics
Section titled “Plausible / privacy-friendly analytics”Placement: Head
<script defer data-domain="example.com" src="https://plausible.io/js/script.js"></script>Chat widget on support pages only
Section titled “Chat widget on support pages only”Placement: Body end · Include paths: /support, /support/*, /pricing
<script src="https://widget.example-chat.com/loader.js" data-id="XXXX" async></script>Site-wide CSS tweak
Section titled “Site-wide CSS tweak”Placement: Head · Priority: 100 (so it comes after other head snippets)
<style> .announcement-bar { display: none; }</style>Blog-only, English-only script
Section titled “Blog-only, English-only script”Placement: Body end · Include paths: /blog, /blog/* · Page kind: Content pages ·
Locales: en