Google Analytics: Create Event Edit Rule
ga4_create_event_edit_ruleCreate a GA4 event edit (modify event) rule on one web stream of the user's connected Google Analytics property: incoming events matching the conditions get parameters set, copied, removed or renamed (event_name) before processing. Runs after the stream's existing edit rules (reorder with ga4_reorder_event_edit_rules) and applies to events received from now on. An identical rule is not created twice. dry_run previews. Changes configuration only after the user approved it.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"property_id": "<property_id>",
"stream_id": "<stream_id>",
"display_name": "<display_name>",
"event_conditions": "<event_conditions>",
"parameter_mutations": "<parameter_mutations>"
},
"name": "ga4_create_event_edit_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | true: read the current configuration and report the field-level changes this call would make, changing nothing. Default false. Show the user the proposal and get their approval before calling without dry_run. | |
| stream_id | Yes | The data stream the rule runs on (a web stream): its number or properties/<p>/dataStreams/<number>, as ga4_get_tracking_configuration lists it. | |
| property_id | Yes | The GA4 property: its number (123456789) or properties/123456789. Must be one of the properties ga4_get_account_summaries lists for the connected login. | |
| display_name | Yes | Rule name shown in GA4, at most 255 characters. | |
| event_conditions | Yes | Conditions an incoming event must meet. All must match (AND), 1–10. Include one on eventName, e.g. [{"field":"eventName","comparison_type":"EQUALS","value":"page_view"},{"field":"page_location","comparison_type":"CONTAINS","value":"/thank-you"}]. | |
| parameter_mutations | Yes | Changes to make to matching events, at least one. At most 20. parameter_value may copy another parameter with [[name]]; "" removes the parameter. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| after | No | The resource after the call (Google's read-back), or the proposal on a dry run. | |
| before | No | The resource before the call; null when it did not exist. | |
| dryRun | Yes | True when the call only previewed the change. | |
| changed | Yes | True only when this call changed Google Analytics. | |
| changes | Yes | Field-level changes: made, or proposed on a dry run. | |
| property | Yes | properties/<number>. | |
| resource | No | Resource name the change targets, when it exists. | |
| verified | No | Whether Google's read-back holds every requested value; null when nothing was written. | |
| operation | Yes | What happened: the change made, no_change, or dry_run. |