agentleFS
arcbaslowarcbaslow/google-analytics-agent/skills/ga4-key-events/SKILL.md

ga4-key-events

Skill0 starsChanged 6 months agoMITView on GitHub

Create or delete GA4 key events (formerly Conversions) via the Admin API. Key events feed conversion reports, Google Ads import, and attribution. Limit: 30 per property.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create / delete via the script.

    line 21
  2. Very specific:

    Avoid making low-signal events like view_item a key event unless your brand-discovery model genuinely needs it.

    line 48
  3. Very specific:

    Every Admin write is gated inside ga4_admin.py: it prints a scrubbed proposal and asks y/N for that operation.

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GA4: Key Events (Conversions)

Scope required: analytics.edit.

Process

  1. List existing key events to confirm headroom (limit: 30).
  2. Show the user the proposed event name and counting method, ask y/n.
  3. Create / delete via the script.

Commands

IntentCommand
Listpython scripts/ga4_admin.py --property X --key-events --json
Createpython scripts/ga4_admin.py --property X --add-key-event purchase --counting-method ONCE_PER_EVENT --json
Deletepython scripts/ga4_admin.py --delete-key-event properties/X/keyEvents/123 --json

Counting methods

  • ONCE_PER_EVENT - every event hit counts (default; matches old "Standard")
  • ONCE_PER_SESSION - one count per session no matter how many fires

High-frequency events (add_to_cart, page_view) use ONCE_PER_EVENT when every fire matters. Lead-gen forms and signup events typically use ONCE_PER_SESSION to avoid double-counting accidental resubmissions.

Common key events by site type

  • E-commerce: purchase; sometimes add_to_cart or begin_checkout for funnel reporting
  • Lead-gen: generate_lead, contact_form_submit, request_demo
  • SaaS: sign_up, plus an activation event (completed_onboarding, first_<feature>)
  • Content / media: subscribe, play_video past a threshold
  • Avoid making low-signal events like view_item a key event unless your brand-discovery model genuinely needs it; otherwise it pollutes Ads bidding

Every Admin write is gated inside ga4_admin.py: it prints a scrubbed proposal and asks y/N for that operation. Run it in an interactive terminal; piped input, EOF and cancellation refuse the write. There is no bypass flag. MCP stdio tools provide previews; confirm=true returns confirmation_required without terminal approval. Never chain writes.

Key-event capacity uses the API custom flag: default key events do not consume the custom limit. At the Standard boundary, creation reads the current property service level: Standard permits 30 custom key events and Analytics 360 permits 50. Unknown service levels defer enforcement to the API. Auth --check --write reports edit-scope evidence and rejects missing or unknown edit scopes; declared scopes are distinguished from granted scopes and do not establish a property role. Legacy OAuth never adds unconsented scopes to stored credentials. Each write still requires its own y/N approval.

MCP propose_admin_write saves one exact Admin proposal for an expiring, single-use terminal approval. The user must run its approval_command and answer the existing y/N prompt themselves; agents must not supply approval. admin_proposal_status only reads the outcome. There is no MCP execute tool, and confirm=true remains insufficient. Refused or failed proposals cannot be replayed; applied:null means the result is unknown. See docs/APPROVALS.md.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.