Repository navigation
Conversation
Add @stackmade/gtm-as-code to the insuit project with bun scripts and an analytics/ config. On PRs the CI runs validate and plan against the live GTM/GA4 and posts the diff as a comment; on main it applies after the site deploy, gated by the production environment. Jobs skip gracefully when the Google credentials/IDs are not configured.
This comment has been minimized.
This comment has been minimized.
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
landsman
commented
Oct 24, 2026
…eploy in its job gtm-code plan exits 2 on changes, which failed the PR job before it could comment; apply only stages a draft, so nothing went live without a publish. The plan job signs in as a read-only account, and a changed GA4 state.json fails the deploy instead of being lost with the runner.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ites Other repos call landsman/homelab/.github/workflows/gtm.yml at a pinned sha; insuit calls it locally. Each step is three lines of shell or less, so gtm.sh went back inline: a script beside one site would not travel with the workflow.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ml to the site root GitHub only finds a reusable workflow directly in .github/workflows/, so gtm/ holds its README, which the config points to. At the site root gtm-code finds analytics.yaml without -c, and the preview no longer rebuilds for it.
This comment has been minimized.
This comment has been minimized.
…eside it Everything GTM sits in .github/actions/gtm: the action, its README and the rules for which changes it acts on. .github/actions/changes reads those rules and outputs one value per feature, so a site's changes job no longer carries its own path list.
This comment has been minimized.
This comment has been minimized.
They address the container in the Tag Manager API and open nothing without granted access, so they need no variable. The GTM action loses its id inputs: a site's config holds them, or reads one from the job's env.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…ariable gone With every id in analytics.yaml, the gtm jobs no longer wait on a repo variable and .env.analytics has nothing left to hold. The setup now starts with where each id is found.
This comment has been minimized.
This comment has been minimized.
|
Feature tests failed on f22783d. |
The contact page pushes contact_email, which analytics.yaml turns into a GTM trigger, a GA4 event tag and a key event. The same change keeps event data 14 months instead of GA4's two, and switches off the stream's site search and form tracking, which this site has nothing for.
This comment has been minimized.
This comment has been minimized.
The page pushes social_click with the network, and analytics.yaml declares it, with network as a GA4 dimension. GA4's own outbound clicks stay on for every other link that leaves the site; it is a different event, so nothing counts twice.
This comment has been minimized.
This comment has been minimized.
…yaml gtm-code generate types every event the config declares, so a misspelt name or a missing parameter fails the typecheck instead of losing data; make qa fails when the generated file lags the config. The contact address now sends generate_lead, the name GA4's lead reports count.
This comment has been minimized.
This comment has been minimized.
bunx hands a node shebang to Node when it is installed; bun run goes through bunfig's run.bun like every other script here.
This comment has been minimized.
This comment has been minimized.
…TM triggers gtm-code 0.9.2 cannot give a click trigger a condition, so the contact page pushes its own events. The caveat holds the YAML that replaces them once it can.
This comment has been minimized.
This comment has been minimized.
…ve regexTable its real shape
|
insuit.cz preview: https://devops-insuit-gtm-as-code.insuit-preview.pages.dev (commit 1c3532a) |
This branch was previously deployed
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.
GTM and GA4 configuration now lives in
insuit/analytics/analytics.yaml:@stackmade/gtm-as-codediffs it against the live container and property, Terraform-style.bun run gtm:validate,gtm:planandgtm:applyscripts, added as a dev dependency alongside the rest of the stack.gtmjob applies after the site deploy, gated by theproductionenvironment.The setup — vars
GTM_ACCOUNT_ID,GTM_CONTAINER_ID,GA4_PROPERTY_IDand Workload Identity Federation secrets — is documented in the insuit README.gtm-code validatepasses under bun.