# Creating a Google Analytics Audience for AI Traffic

To properly segment AI traffic in your Google Analytics 4 property, you'll need to create a custom audience. This will allow you to:

- Analyze AI traffic separately from human visitors
- Compare bot behavior with human behavior
- Create reports that include or exclude AI traffic as needed

Follow these steps to create an audience for AI traffic:

1. **Open Google Analytics**  
   Go to [Google Analytics](https://analytics.google.com/) and sign in.  
   Click the **Admin** icon in the lower left corner.
   ![](/images/docs/google_analytics_api_secret_step_1.png)

2. **Navigate to Audiences**  
   Under the Data Display column, click **Audiences**.
   ![](/images/docs/google_analytics_audiences.png)

3. **Create a New Audience**  
   Click **New audience**, then select **Create a custom audience**.
   Give your audience a descriptive name, such as "AI Visitors".
   ![](/images/docs/google_analytics_new_audience.png)

4. **Define Audience Conditions**  
   Click **Add new condition**.
   In the dimension dropdown, search for and select **Source**.
   Set the operator to **exactly matches**.
   Enter `AI Visit` as the value.
   
   This will capture all the AI traffic that our system sends to your GA4 property.
   ![](/images/docs/google_analytics_audience_condition.png)

5. **Optional: Refine Your Audience**  
   For more specific audiences, you can add additional conditions:
   
   - To segment by specific AI types, add a condition where **Campaign term** exactly matches the bot name (e.g., "ChatGPT User")
   - To segment by AI provider, add a condition where **Campaign** exactly matches the company name (e.g., "OpenAI") 
   - To segment by AI category, add a condition where **Campaign content** exactly matches the subcategory (e.g., "AI Assistant")

6. **Save Your Audience**  
   Click **Save** to create your audience.
   
   Note: It may take 24-48 hours for your audience to start populating with data.
   ![](/images/docs/google_analytics_save_audience.png)

7. **Using Your Audience**  
   Once created, you can:
   - View audience-specific reports by selecting your audience from the audience dropdown in any report
   - Create comparisons between your AI audience and other segments
   - Exclude AI traffic from reports by creating a comparison that excludes this audience

   ![](/images/docs/google_analytics_use_audience.png)

---

**Important Notes:**
- Spyglasses automatically sets `source = "AI Visit"` and `medium = "ai-agent"` for all AI traffic
- The bot name is sent as `campaign term` (e.g., "ChatGPT User")
- The company name is sent as `campaign` (e.g., "OpenAI")
- The AI subcategory is sent as `campaign content` (e.g., "AI Assistant")

**Next Steps:**
- Consider creating multiple audiences for different types of AI traffic
- Set up custom reports that compare human vs. AI behavior
- Create dashboard cards that focus on AI traffic patterns
