Analytics-tracking-automation analytics-tracking-automation
Use when you need GA4 + GTM tracking delivery from site discovery through publish, or when the right phase entry point is still unclear.
git clone https://github.com/jtrackingai/analytics-tracking-automation
git clone --depth=1 https://github.com/jtrackingai/analytics-tracking-automation ~/.claude/skills/jtrackingai-analytics-tracking-automation-analytics-tracking-automation
SKILL.mdAnalytics Tracking Automation
Use this skill as the end-to-end coordinator for GA4 + GTM tracking delivery.
Use it when:
- the user needs a full GA4 + GTM implementation flow, from analysis to go-live readiness
- the request spans multiple workflow phases (discovery, schema, sync, verification, publish)
- the correct entry point is still unclear and you need this skill to route to the right phase
Do not assume the user wants the full workflow.
<!-- analytics-tracking-automation auto-update bootstrap:start -->Auto-Update
This installed root skill can self-check for newer GitHub versions before you continue.
Before doing any task in this bundle:
- Resolve the directory that contains this installed
. Installer-managed copies usually live under the skills directory configured by your agent environment, such asSKILL.md
or an equivalent runtime-managed path.$CODEX_HOME/skills/analytics-tracking-automation - Run
.node "<bundle-dir>/runtime/skill-runtime/update-check.mjs" --json - If the result status is
, immediately runupdate_available
.node "<bundle-dir>/runtime/skill-runtime/self-update.mjs" --apply - If the update succeeds, read
again before continuing so you are using the refreshed instructions.<bundle-dir>/SKILL.md - If the result status is
, treat this bundle as a local development link or repo checkout and continue without updating.disabled
Skill Family
The skill family is split into one umbrella skill plus seven phase skills:
for crawl coverage, platform detection, and fresh artifact bootstraptracking-discover
for page-group authoring and approvaltracking-group
for auditing the real live GTM runtime before schema generationtracking-live-gtm
for schema preparation, review, validation, and approvaltracking-schema
for GTM config generation and synctracking-sync
for preview QA and optional publish handofftracking-verify
for Shopify-specific schema, sync, install, and verification rulestracking-shopify
If the request is already bounded to one phase and that phase skill is available, route there instead of inlining the full runbook here.
Once
site-analysis.json indicates Shopify, keep discovery and grouping shared, then let tracking-shopify own the Shopify-specific branch.
Shared Contract
- Use the repo-local wrapper
in this repository. If./event-tracking
is missing, rundist/cli.js
first.npm run build - For public/ClawHub installs, you must run this first before any
command:event-tracking
.npx skills add jtrackingai/analytics-tracking-automation - Keep one artifact directory per site at
.<output-root>/<url-slug> - If the user already provides an artifact directory or one of its files, resume from the earliest unmet prerequisite instead of restarting from
.analyze - Use
whenever the current checkpoint or next step is unclear../event-tracking status <artifact-dir-or-file> - Use
when the artifact directory is unknown but the output root is known../event-tracking runs <output-root> - Prefer high-level entry commands for user-facing flows:
,run-new-setup
,run-tracking-update
,run-upkeep
.run-health-audit - Telemetry consent is a required user-choice checkpoint. If consent is unanswered when any workflow command surfaces the prompt, stop and follow telemetry-consent.md as the single-source interaction contract. Never decide
/yes
on the user's behalf, and continue through the interactive prompt so the local config records their choice.no - Treat workflow mode metadata as an internal workflow-state layer, not a user-facing command surface.
,analyze
,validate-schema --check-selectors
, andpreview
each need outbound HTTP and a real Chromium;sync
additionally needs a local loopback callback onsync
for Google's OAuth consent redirect. Run them in an environment that permits those capabilities so Playwright and the OAuth callback can complete.127.0.0.1- Run prompt-driven GTM sync with an interactive TTY from the start unless exact
,--account-id
, and--container-id
values are already confirmed.--workspace-id - Never auto-select a GTM account, container, or workspace on the user's behalf.
- Do not continue past the phase boundary the user asked for.
Conversation Intake
When the user enters through chat and has not yet provided a bounded phase, artifact directory, or exact command, start with an intent-first intake.
Classify the request into one of these entry intents:
: the user already has an artifact directory or one of its files; inspect the artifacts and useresume_existing_runstatus
: net-new tracking implementation from scratch; prefernew_setup
, then follow its recommended next steprun-new-setup
: revise or extend an existing implementation; prefertracking_updaterun-tracking-update
: routine maintenance, review, or incremental QA on an existing setup; preferupkeeprun-upkeep
: audit-only assessment of current live tracking; prefertracking_health_auditrun-health-audit
: crawl/bootstrap/discovery only without committing to the full workflow yet; route toanalysis_only
and stop aftertracking-discoveranalyze
Rules:
- Do not ask the user to choose between internal workflow metadata flags and
.analyze - If intent is ambiguous, ask one short plain-language intake question using user-facing terms such as "new setup", "update existing tracking", "upkeep", "health audit", "analyze only", or "resume an existing run".
- If the user gives a fresh URL and asks to set up tracking, default to
.new_setup - If the user gives a fresh URL and only asks to inspect the site, analyze structure, or review current tracking signals, default to
.analysis_only - If the user gives an artifact directory or workflow file, default to
instead of restarting fromresume_existing_run
.analyze
Routing Rules
Route by user intent and current artifacts:
- fresh URL, crawl request, or no artifacts yet: start with
tracking-discover
with missing or unconfirmedsite-analysis.json
: route topageGroupstracking-group- confirmed
with detected live GTM container IDs but no live baseline review yet: route tosite-analysis.jsontracking-live-gtm - confirmed
or an in-progresssite-analysis.json
: route toevent-schema.jsontracking-schema - approved
withoutevent-schema.json
: route togtm-config.json
fortracking-syncgenerate-gtm
: route togtm-config.jsontracking-sync
: route togtm-context.json
, with publish treated as a separate explicit actiontracking-verify- Shopify platform confirmation: keep shared early stages, then hand off to
tracking-shopify
If only the root skill is available, follow the same routing logic directly and stop at the matching phase boundary.
Stop Rules
- Do not bypass page-group approval before
.prepare-schema - For key decision checkpoints, always require explicit user confirmation before continuing:
(beforepageGroups
and beforeconfirm-page-groups
)prepare-schema
(beforeevent-schema.json
and beforeconfirm-schema
)generate-gtm- GTM target selection (account/container/workspace during
)sync - publish decision (before
)publish
- If confirmation is missing or ambiguous, stop and ask; do not auto-proceed.
- Treat telemetry consent the same way as other explicit approval gates: if the user has not chosen
oryes
, stop and ask instead of making the decision for them.no - A broad request such as "full workflow", "全流程", "end-to-end", or "continue all the way" is scope authorization only. It does not count as checkpoint approval.
- Never record checkpoint approval on the user's behalf with
orconfirm-page-groups --yes
unless the user explicitly confirms that checkpoint in the current turn.confirm-schema --yes - When live GTM containers are detected on the site, do not bypass the live baseline review before schema generation.
- Do not bypass schema approval before
unless the user explicitly wantsgenerate-gtm
.--force - Treat preview QA and publish as separate decisions.
- Treat
as the publish gate; do not jump to publish when health is missing, manual-only, or blocked unless the user explicitly wantstracking-health.json
.--force - Treat Shopify manual verification as the expected path for Shopify runs, not as a fallback error case.
- Treat
as an audit-only workflow mode. Do not run GTM deployment actions (tracking_health_audit
,generate-gtm
,sync
) unless the user explicitly asks to override.publish
Resume And Closeout
When resuming:
- prefer
when presentworkflow-state.json - still inspect the real artifact set if warnings indicate stale gates
- use
when the next step is unclearstatus
When a phase or the full workflow ends, keep the closeout answer-first:
- lead with a compact, decision-ready summary in plain language
- do not dump raw JSON, raw URL lists, or artifact inventory before the summary
- list files, checkpoint, and next command only after the human-readable summary
References
- skill-map.md for the umbrella / phase skill map
- architecture.md for lifecycle, checkpoints, and resume semantics
- output-contract.md for artifact files and gate semantics
- shopify-workflow.md for Shopify-specific branch expectations
- telemetry-consent.md for the telemetry consent gate wording and behavior contract