From data-arsenal
Creates or updates business context project from website URL for GA4 analysis, auto-extracting business name, description, type, platform into config.json and context.md.
How this command is triggered — by the user, by Claude, or both
Slash command
/data-arsenal:ga4-contextThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
# /ga4-context - Website-First Context Builder Creates a project with business context by auto-extracting information from the client's website first, then validating and filling gaps with minimal interaction. ## Usage `/ga4-context [client_name] [url]` ## Project Structure Projects are stored at `~/.config/data-arsenal/projects/<slug>/`. Each project contains: - `config.json` — Structured business context (machine-readable) - `context.md` — Narrative context with enrichment (human-readable) - `data-quality.json` — Last audit results (written by /ga4-audit) - `briefing-log.json` — Histo...
Creates a project with business context by auto-extracting information from the client's website first, then validating and filling gaps with minimal interaction.
/ga4-context [client_name] [url]
Projects are stored at ~/.config/data-arsenal/projects/<slug>/. Each project contains:
config.json — Structured business context (machine-readable)context.md — Narrative context with enrichment (human-readable)data-quality.json — Last audit results (written by /ga4-audit)briefing-log.json — History of past briefings (written by /ga4-brief)reports/ — Generated PDFsRead ~/.config/data-arsenal/config.json. Check the language key.
language is set → use that language for all commentary and questions. Data labels and GA4 metric names stay in English.language is NOT set (first run) → output as plain text (NOT AskUserQuestion):
"What language should I use? (English / Bulgarian / other)"
Wait for the user to type their response naturally (e.g., "bg", "Bulgarian", "english").
Interpret the response and save to ~/.config/data-arsenal/config.json so it's never asked again.All subsequent output uses the chosen language.
If client_name and url were provided as arguments, use them. Otherwise output as plain text (NOT AskUserQuestion):
"Please provide:
Wait for the user to type both in one message. Parse the response naturally.
Slugify the project name (lowercase, hyphens, no special chars).
mkdir -p ~/.config/data-arsenal/projects/<slug>/reports
If ~/.config/data-arsenal/projects/<slug>/config.json already exists, ask: "Project exists. Update existing context or start fresh?"
Before asking any business questions, WebFetch the homepage URL. Extract everything possible:
Do NOT report on tracking tags (GTM, GA4, Meta Pixel, Facebook Pixel, LinkedIn, TikTok, etc.) or consent banners (CookieBot, OneTrust, etc.). WebFetch returns raw HTML which misses dynamically-loaded tags, producing false negatives that mislead users. Skip any tracking/consent analysis entirely.
<title>, og:site_name, header logo alt text<meta name="description"> or og:description<nav> elements, main menu links → infer product/service categoriesIf the user mentioned specific pages (e.g., "services page", "about us"), WebFetch those too for additional context.
Show what was extracted, then ask ALL business questions in a single plain text block. Do NOT use AskUserQuestion — output as plain text so the user can type a free-form response:
IMPORTANT: Output ONLY the fields shown in the template below. Do NOT add tracking tags, pixels, consent banners, or any other fields. WebFetch HTML is unreliable for detecting dynamically-loaded scripts — reporting their presence/absence misleads users.
Here's what I found from your website:
Business: [name] — [description]
Type: [ecommerce / B2B services / lead-gen]
Platform: [WordPress / Shopify / custom]
Services/Products: [list from nav]
Market: [UK / Bulgaria / etc. based on clues]
Value props: [list]
To complete the context, please answer what you can (skip any you don't know):
1. Main business goals? (traffic / leads / sales / brand awareness)
2. Key metric you're optimizing?
3. Priority marketing channel?
4. Main competitors? (names only)
5. Target SEO keywords?
6. Specific problem to investigate?
7. Peak/low seasons?
The user answers in one message, can skip anything. Parse their response naturally — partial answers are fine.
For each competitor name provided:
"[competitor name] [industry/location]" to find their URLenrichment.competitors[]Do NOT ask "Which GA4 property does this use?" — instead, auto-resolve:
resolve_property() from _ga4_lib.pyIf property found, run a quick data pull to pre-fill what we can:
# Top channels by sessions (pre-fill active_channels)
~/.config/data-arsenal/scripts/ga4-report <property_id> --metrics sessions --dimensions sessionDefaultChannelGroup --days 30
# Conversion rate and AOV if ecommerce
~/.config/data-arsenal/scripts/ga4-report <property_id> --metrics sessions,ecommercePurchases,purchaseRevenue --days 30
Always show date ranges in data output:
GA4 data from last 30 days (Feb 19 - Mar 21, 2026)
From results:
funnel.active_channels with channels that have >5% sharefunnel.conversion_ratefunnel.average_order_value if purchase data existsbusiness_type as ecommerceUse AskUserQuestion (YES/NO only): "Context ready. Save it?"
If yes, proceed to save. If no, ask what to change.
Write config.json to ~/.config/data-arsenal/projects/<slug>/config.json:
contexts/_template.json as the structurewhat_changed section as empty (tell user they can update it later with /ga4-context <slug>)last_updated to today's dateWrite context.md to ~/.config/data-arsenal/projects/<slug>/context.md:
contexts/_template.md/ga4-context <slug> to update"Initialize briefing-log.json:
{ "briefings": [] }
Legacy compatibility: Also save context.md to ~/.config/data-arsenal/contexts/<slug>.md so older commands can still find it.
Suggest next steps:
/ga4-audit <property> — Run health checks (recommended first)/ga4-brief <property> — Run what-changed analysis with this contextAccept property name, URL, project slug, or numeric ID:
~/.config/data-arsenal/projects/ → read property_id from that project's config.jsonresolve_property() from _ga4_lib.py to search GA4 account by name/ga4-audit for tracking verification insteadnpx claudepluginhub ivanovzlatan2/data-arsenal-v1