# Creating Custom Channel Groups for AI Traffic

## Understanding Channel Groups in GA4

A channel group in Google Analytics 4 is a set of rule-based categories for your website's traffic sources. While GA4 has a default channel group with predefined channels (like Direct, Organic Search, Social, etc.), you can create custom channel groups to better segment AI traffic.

Custom channel groups allow you to:
- Create specific categories for different types of AI traffic
- Analyze AI traffic separately from standard traffic sources
- Compare different AI sources in acquisition reports
- Use these segments in custom reports and explorations

## Why Create Custom Channel Groups for AI Traffic

Since Spyglasses sends AI traffic with the source set to `referral`, this traffic might be mixed with other referral traffic in standard reports. Creating a custom channel group lets you:

1. Isolate all AI traffic into its own channel
2. Create sub-channels for different AI providers or bot types
3. Compare performance metrics across different AI sources
4. Make AI traffic analysis a standard part of your reporting

## Creating a Custom Channel Group for AI Traffic

To create a custom channel group for AI traffic:

1. **Open Google Analytics** and go to the Admin section
2. Under **Data Display**, click **Channel Groups**
3. Click **Create new channel group** (this will start with a copy of the default group)
4. Enter a name like "AI Traffic Channels" and a description
5. Edit the existing channels as needed, and add new channels specifically for AI traffic

### Example AI Traffic Channels

Here's how you might structure an AI traffic channel group:

#### 1. Create an "AI Traffic" channel
- Click **Add new channel**
- Name: "AI Traffic (All)"
- Add condition: 
  - Source exactly matches `referral`
  - Medium exactly matches `ai-agent`

#### 2. Create channels for specific AI companies
- Add a channel for each major AI company:
  - Name: "OpenAI"
  - Add condition:
    - Source exactly matches `referral`
    - Medium exactly matches `ai-agent`
    - Campaign exactly matches `OpenAI`

- Repeat for other companies:
  - "Anthropic" (for Claude)
  - "Google" (for Bard/Gemini)
  - "Microsoft" (for Bing)
  - etc.

#### 3. Create channels for specific bot types (optional)
- Add channels for specific bot types:
  - Name: "ChatGPT"
  - Add condition:
    - Source exactly matches `referral`
    - Medium exactly matches `ai-agent`
    - Campaign term exactly matches `ChatGPT User`

### Channel Order Matters

Remember that traffic is assigned to the first matching channel in your group, based on the order. Typically, you should:

1. Order from most specific to most general
2. Place your specialized AI channels at the top
3. Put the catch-all "AI Traffic (All)" channel after your specific AI channels
4. Keep standard channels (Direct, Organic Search, etc.) below your AI channels

## Using Your Custom Channel Group

Once created, you can use your custom channel group in various reports:

- In **Acquisition** reports, select your custom channel group as the primary dimension
- In standard reports, add your custom channel group as a secondary dimension
- In **Explorations**, add your custom channel group as a dimension
- When building **Audiences**, use your custom channel group in conditions

## Limits on Custom Channel Groups

GA4 has the following limits on custom channel groups:

- **Standard properties**: 2 custom channel groups (plus the predefined default)
- **GA4 360 properties**: 5 custom channel groups (plus the predefined default)
- Each custom channel group can contain up to 50 channels

## Setting Your Channel Group as Primary

For easier access, you can set your AI traffic channel group as the primary channel group:

1. Go to **Admin** > **Channel Groups**
2. Click the pencil icon next to the primary channel group setting
3. Select your custom AI traffic channel group

This makes your AI traffic channel group the default dimension in applicable reports.

## Pro Tips

- Custom channel groups can be applied retroactively to historical data
- Create a specialized "Debug" channel to identify testing/development traffic
- Consider creating separate channels for mobile app AI traffic vs. web AI traffic
- Update your custom dashboard to include widgets using your new channel group

---

By properly configuring custom channel groups, you'll have much clearer visibility into how AI agents interact with your site compared to human visitors, and can make better decisions about content optimization for both audiences.
