Administrators configure tracking and support widgets in the admin panel, but nothing injects them into your theme automatically. Your templates render them, which means a theme that skips this silently breaks features the site owner configured and paid for.
If your theme doesn’t include these snippets, the analytics and support codes set in the admin panel never load on the public site. Include them, even in a minimal theme.
Three insertion points
The convention is one snippet per position, included by the layout:
Custom code blocks
Administrators can paste arbitrary markup, which may itself contain Twig-style placeholders. Compile it with the template() function before including it:
snippets/script-tags/head.twig
template() compiles a string into a template with strict variables disabled, so a typo in the pasted snippet doesn’t take the page down.
Google Tag Manager
The matching noscript iframe belongs in body.twig:
Google Analytics
Intercom
Intercom needs visitor details when someone is signed in, and a signed hash when identity verification is on:
hash_hmac() is available in templates precisely for this. It runs server-side, so the secret never reaches the browser.
Never print option.script_tags.intercom.secret_key, or any other secret, into the page. Only the computed hash belongs in the output.
Guard everything
Every block above is wrapped in a check, for two reasons: debug mode raises errors on undefined variables, and an enabled integration with a missing ID emits a broken tag. Check both the toggle and the identifier.
Copying the snippets
The fastest way to get this right is to copy the three snippets from the starter kit into your theme unchanged, then include them from your layout. They’re plain Twig with no dependency on the rest of the starter.