> ## 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 Channel Groups

> Creates, updates or deletes Google Analytics 4 custom channel groups from native grouping rules, and can make one the primary channel group used in reports

Creates, updates or deletes Google Analytics 4 custom channel groups from native grouping rules, and can make one the primary channel group used in reports. The Default Channel Group cannot be changed.

| | |
| - | - |
| **App** | GA4 |
| **Operation ID** | `ga4_manage_channel_groups` |
| **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 to change. Only one property at a time. |
| `action` | string or SelectableOption | Yes | - | 'create' adds a custom channel group; 'update' changes its name, description, rules or primary flag; 'delete' removes it. The Default Channel Group defined by Google cannot be changed or deleted. Options: 'create', 'update', 'delete'. |
| `channel_group_id` | string | No | - | Numeric id of the channel group to update or delete. Read ids from ga4\_get\_property\_settings with setting 'channel\_groups'. |
| `display_name` | string | No | - | Channel group name shown in reports (max 80 chars). Required on create. |
| `description` | string | No | - | Optional description (max 256 chars). |
| `grouping_rule` | array of object or string | No | - | Channels in evaluation order as the Admin API groupingRule array (object or JSON string), sent as-is and validated by Google; traffic that matches no rule falls into 'Unassigned'. Each rule has displayName and an expression; Google requires the expression to be an andGroup whose children are orGroups, with the filters (or notExpression) inside the orGroup. A filter has fieldName, one of 'eachScopeSource', 'eachScopeMedium', 'eachScopeCampaignName', 'eachScopeCampaignId', 'eachScopeSourcePlatform' or 'eachScopeDefaultChannelGroup' (verified live; plain names such as 'medium' are rejected), with stringFilter \{matchType EXACT, BEGINS\_WITH, ENDS\_WITH, CONTAINS, FULL\_REGEXP or PARTIAL\_REGEXP, value, caseSensitive} or inListFilter \{values}. Example: \[\{"displayName":"Brand Paid Search","expression":\{"andGroup":\{"filterExpressions":\[\{"orGroup":\{"filterExpressions":\[\{"filter":\{"fieldName":"eachScopeMedium","stringFilter":\{"matchType":"EXACT","value":"cpc"}}}]}},\{"orGroup":\{"filterExpressions":\[\{"filter":\{"fieldName":"eachScopeCampaignName","stringFilter":\{"matchType":"CONTAINS","value":"brand"}}}]}}]}}}]. Up to 50 rules. Required on create; on update the full list replaces the existing rules. |
| `primary` | boolean | No | - | When true, this group becomes the default channel group used in reports. Only one group can be primary. |

### SelectableOption

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

## Output

**Type**: `Dict`

Returns the saved channel group: id, name, description, primary flag and channel names.

**Fields**: `property_id`, `status`, `channel_group_id`, `display_name`, `description`, `primary`, `system_defined`, `channels`


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