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

ga4-events-edit

Skill0 starsChanged 6 months agoMITView on GitHub

Edit GA4 events via the Admin API. Wraps EventEditRule (rename/rewrite incoming events, modify parameters) and EventCreateRule (synthesize new events from existing ones). Per-data-stream. Triggers: 'rename an event', 'change event parameter', 'create event rule', 'modify event'.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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. Very specific:

    If the user does not pass --stream, list streams with python scripts/ga4_admin.py --property <id> --streams --json and ask them to pick.

    line 28
  2. Very specific:

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

    line 88

≈ “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: Edit Events

EventCreateRule and EventEditRule live per data stream, not per property, so every command needs both --property and --stream.

Scope required: analytics.edit. If the user is on read-only auth, instruct them to run:

gcloud auth application-default login --scopes=https://www.googleapis.com/auth/analytics.edit,https://www.googleapis.com/auth/cloud-platform

Process

  1. Verify auth: python scripts/ga4_auth.py --check
  2. If the user does not pass --stream, list streams with python scripts/ga4_admin.py --property <id> --streams --json and ask them to pick.
  3. For diagnostic-driven proposals, spawn the ga4-events-editor agent.
  4. Print the resolved rule JSON to the user and ask y/n before any write.
  5. Run the script.

Direct commands

IntentCommand
List rules on a streampython scripts/ga4_admin.py --property X --stream Y --list-event-rules --json
Add an edit rulepython scripts/ga4_admin.py --property X --stream Y --add-edit-rule rule.json --json
Add a create rulepython scripts/ga4_admin.py --property X --stream Y --add-create-rule rule.json --json
Delete an edit rulepython scripts/ga4_admin.py --rule-name <full> --delete-edit-rule --json
Delete a create rulepython scripts/ga4_admin.py --rule-name <full> --delete-create-rule --json

Rule JSON shapes

EventEditRule (rewrite an existing event):

{
  "display_name": "Normalize signup events",
  "event_conditions": [
    {"field": "event_name", "comparison_type": "EQUAL", "value": "signed_up"}
  ],
  "parameter_mutations": [
    {"parameter": "event_name", "parameter_value": "sign_up"}
  ]
}

EventCreateRule (synthesize a new event from another):

{
  "destination_event": "engaged_view",
  "event_conditions": [
    {"field": "event_name", "comparison_type": "EQUAL", "value": "page_view"},
    {"field": "engagement_time_msec", "comparison_type": "GREATER_THAN", "value": "30000"}
  ],
  "source_copy_parameters": true,
  "parameter_mutations": []
}

Limits and constraints

  • v1alpha API - schema may change; recheck on SDK bump.
  • Web streams only (per current Admin docs).
  • Edit rules run in a defined order; use reorder_event_edit_rules to rearrange.
  • Edit rules cannot modify events produced by create rules.

Common mistakes to flag

  • Renaming purchase - breaks every conversion report and Ads import. Refuse without explicit confirmation in the message.
  • Mutating transaction_id - kills duplicate-purchase detection.
  • Creating a synthesized event whose name collides with a real one - produces double-counting.

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.

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.