> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage Event Rules

> Creates, updates, deletes or reorders Google Analytics 4 event rules on a data stream: Create Event rules derive a new event from a matching one (e.g

Creates, updates, deletes or reorders Google Analytics 4 event rules on a data stream: Create Event rules derive a new event from a matching one (e.g. generate\_lead from form\_submit) and Modify Event rules change parameters of matching events, without code changes.

| | |
| - | - |
| **App** | GA4 |
| **Operation ID** | `ga4_manage_event_rules` |
| **Type** | Action |
| **Connection** | `ga4` (required) |
| **Credits per run** | 1 |
| **Agent / MCP tool** | Yes |
| **Requires approval** | Yes (write operation) |

## Inputs

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `account` | array (also accepts a comma-separated string) | No | - | The GA4 property that owns the data stream. Only one property at a time. |
| `data_stream_id` | string | Yes | - | Numeric id of the data stream the rule belongs to, e.g. '7613215464'. Read it from ga4\_get\_property\_settings with setting 'data\_streams'. |
| `rule_type` | string or SelectableOption | Yes | - | 'create' for Create Event rules, which make a new event from a matching source event (e.g. generate\_lead from form\_submit); 'edit' for Modify Event rules, which change parameters of a matching event in place. Options: 'create', 'edit'. |
| `action` | string or SelectableOption | Yes | - | 'create', 'update' or 'delete' a rule; 'reorder' sets the processing order of all Modify Event rules on the stream (rule\_type 'edit' only). Options: 'create', 'update', 'delete', 'reorder'. |
| `rule_id` | string | No | - | Numeric id of the rule to update or delete, e.g. '1234567890'. |
| `destination_event` | string | No | - | Create Event rules: name of the new event, e.g. 'generate\_lead'. Under 40 characters, letters, digits and underscores only. Required on create. |
| `display_name` | string | No | - | Modify Event rules: name of the rule shown in GA4 (max 255 chars). Required on create. |
| `event_conditions` | array of object or string | No | - | Conditions a source event must meet, as the Admin API eventConditions array (object or JSON string), sent as-is: each has field (an event parameter name or 'event\_name'), comparisonType (EQUALS, EQUALS\_CASE\_INSENSITIVE, CONTAINS, CONTAINS\_CASE\_INSENSITIVE, STARTS\_WITH, STARTS\_WITH\_CASE\_INSENSITIVE, ENDS\_WITH, ENDS\_WITH\_CASE\_INSENSITIVE, GREATER\_THAN, GREATER\_THAN\_OR\_EQUAL, LESS\_THAN, LESS\_THAN\_OR\_EQUAL, REGULAR\_EXPRESSION, REGULAR\_EXPRESSION\_CASE\_INSENSITIVE), value and optional negated. Example: \[\{"field":"event\_name","comparisonType":"EQUALS","value":"form\_submit"},\{"field":"form\_id","comparisonType":"EQUALS","value":"contact"}]. One to ten conditions. Required on create. |
| `source_copy_parameters` | boolean | No | - | Create Event rules: copy the source event's parameters onto the new event. |
| `parameter_mutations` | array of object or string | No | - | Parameters to set on the resulting event, as the Admin API parameterMutations array (object or JSON string), applied in order: \[\{"parameter":"lead\_source","parameterValue":"website"}]. Use the value '\[\[param]]' to copy another parameter. Up to 20 mutations. Required on create for Modify Event rules, optional for Create Event rules. |
| `rule_ids` | string or array of string | No | - | reorder only: every Modify Event rule id on the stream in the desired processing order, e.g. \['123', '456']. |

### SelectableOption

| Field | Type | Required | Default | Description |
| - | - | - | - | - |
| `value` | string | Yes | - | |
| `label` | string | Yes | - | |

## Output

**Type**: `Dict`

Returns the saved rule: id, conditions, parameter mutations, and destination event or display name and processing order.

**Fields**: dynamic (depend on the inputs)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.