Add config-driven GTM, Meta Pixel, and Facebook verification#459
Open
vittorio88 wants to merge 1 commit intodevcows:masterfrom
Open
Add config-driven GTM, Meta Pixel, and Facebook verification#459vittorio88 wants to merge 1 commit intodevcows:masterfrom
vittorio88 wants to merge 1 commit intodevcows:masterfrom
Conversation
…cation New partials driven by site params: - gtm_id: Google Tag Manager (head script + body noscript) - meta_pixel_id: Meta/Facebook Pixel - facebook_domain_verification: Facebook domain verification meta tag All are optional — if the param is not set, nothing is rendered. GTM body noscript is injected in all 5 layout files after <body>. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds optional, config-driven support for three common tracking/verification tools:
gtm_id) — head script + body noscript fallbackmeta_pixel_id) — tracking pixel with noscript fallbackfacebook_domain_verification) — meta tagAll are opt-in: if the param is not set, nothing is rendered.
Configuration
Add any combination to
config.toml/hugo.toml:Files changed
facebook-verification.html,gtm-head.html,gtm-body.html,meta-pixel-head.htmlheaders.html: includes head-level partialsindex,single,list,page/single,404): GTM body noscript after<body>exampleSite/hugo.toml: commented-out example configTest plan
gtm_idand verify GTM script in<head>and noscript after<body>meta_pixel_idand verify pixel code in<head>facebook_domain_verificationand verify meta tag in<head>