Knowing where your customers first hit your brand is non-negotiable for spending your marketing budget wisely, especially with AI agents now handling so much of the initial search and discovery. This tutorial walks through the exact steps for configuring AI agent attribution so you can track first-touch points inside Google Ads Manager in 2026 and finally pin down where your leads actually come from.
Key Takeaways
- In Google Ads Conversion Settings, you need to enable “AI Interaction Signals” and then define your specific agent IDs to get accurate first-touch attribution.
- You have to implement detailed tracking parameters like
ai_agent_idandinteraction_typeinto your PPC campaign URLs using Google Tag Manager (GTM). - To see what’s working, segment your Google Ads reports using the custom dimension “First Interaction Source (AI Agent)” which isolates performance data coming from AI agent discovery.
- Double-check your AI agent attribution data by cross-referencing it with Google Analytics 4 (GA4) “Session Source / Medium” reports, filtering for your specific AI agent identifiers to make sure the numbers line up.
Step 1: Configure AI Agent Recognition in Google Ads Manager
You won’t get accurate attribution if your ad platform isn’t set up correctly from the start. As of 2026, Google Ads Manager has specific settings to tell the difference between an AI agent interaction and a regular user query, which is a huge help for brands trying to understand their real discovery channels.
1.1 Access Conversion Settings
- Log in to your Google Ads Manager account.
- Find the Tools and Settings wrench icon on the left navigation and click it.
- Under the “Measurement” column, go to Conversions.
- Pick the conversion action you want to edit for AI agent tracking (like “Website Lead Form Submission”). If you don’t have one set up yet, click the blue plus button, select “Website” as the type, and create one.
1.2 Enable AI Interaction Signals
Inside the settings for your chosen conversion action, you’ll see the advanced attribution options. This is where you tell Google Ads what signals to look for that point to an AI agent’s involvement.
- Scroll down to the “Attribution model” section. You’ll probably keep your current model (like Data-driven or Last click), but you’ll see a new toggle for “Include AI Interaction Signals”. Flip this to On.
- A new “AI Agent Identification” sub-section will pop up. This is how Google Ads will recognize the agents. Choose “Custom AI Agent ID”.
- An input field will show up where you’ll enter the unique identifiers your AI agents use. This could be a specific user-agent string, a custom URL parameter, or a referrer header. For instance, if your own AI agent, “BrandBot,” adds
&agent_id=BrandBotto URLs, you’d tell Google Ads to look for “BrandBot” in thatagent_idparameter. - Click Save. This initial setup is absolutely essential for any subsequent tracking to work.
Pro Tip: So many brands mess this up, consistent AI agent identification is often overlooked. Make sure your development team uses a single, standardized identifier across all AI agents that might touch your paid media. Using inconsistent names just fragments your data and gives you useless attribution reports.
Step 2: Implement Granular Tracking Parameters for PPC
To really track first-touch attribution from an AI agent that came from a paid campaign, you’ve got to add specific parameters to your Google Ads URLs. This is what gives you the detailed data you need for proper segmentation and analysis later on.
2.1 Modify Tracking Templates in Google Ads
This part ensures every single click from your ads carries the info needed for AI agent identification.
- Head back to your Google Ads Manager account.
- On the left menu, click Campaigns.
- Pick the campaign or ad group you’re working on. Honestly, I recommend applying this at the account level to track everything. To do that, go to Settings in the left menu, then Account settings, and click Tracking.
- Find the “Tracking template” field.
- Add these parameters to whatever template you already have. If it’s empty, start with this:
{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&ai_agent_id={_ai_agent_id}&interaction_type={_interaction_type} - The
{_ai_agent_id}and{_interaction_type}parts are custom parameters we’re about to define, while{lpurl}just makes sure your landing page URL gets pulled in correctly. - Always click Test to make sure your URLs don’t break.
- Click Save.
2.2 Define Custom Parameters in Google Ads
These custom parameters are what feed the specific AI agent information into the tracking template you just set up.
- You should still be in the Tracking section of your Account Settings. Scroll down to “Custom parameters”.
- Click the blue plus button to add a new one.
- For the first parameter:
- Name:
_ai_agent_id - Value: This needs to be populated dynamically based on how your AI agent identifies itself. If the agent uses a unique user-agent or passes a specific string, your landing page needs to be built to grab it and put it here. For a quick and dirty setup, you could just put in a default value like
"unknown_ai"and then get more sophisticated later.
- Name:
- For the second parameter:
- Name:
_interaction_type - Value: Just like the agent ID, this should describe what the AI was doing (e.g.,
"discovery_query","comparison_assist"). If you can’t populate this dynamically yet, start with a default like"direct_click".
- Name:
- Click Save.
This whole setup depends on your website being able to detect these values and pass them along. When an AI agent hits your landing page, a script on your site has to identify it and then populate these custom parameters in the URL string. This almost always requires some back-and-forth with your web development team to get the parameters captured and passed correctly.
Step 3: Configure Google Tag Manager for AI Agent Data Layer Integration
Google Tag Manager (GTM) is the bridge between your website spotting an AI agent and that data getting sent to Google Analytics 4 (GA4) and Google Ads. Getting this step right is how you’ll reliably capture first-touch data.
3.1 Create Data Layer Variables for AI Agent Information
Your website’s front-end code needs to push the AI agent’s ID into the data layer as soon as it lands on your site.
- Log in to your GTM account.
- Go to Variables from the left menu.
- Under “User-Defined Variables,” click New.
- For the first variable:
- Variable Type: Data Layer Variable
- Data Layer Variable Name:
aiAgentId(this has to exactly match the variable name your devs are pushing) - Data Layer Version: Version 2
- Name:
DL - AI Agent ID
- Do it again for the second variable:
- Variable Type: Data Layer Variable
- Data Layer Variable Name:
aiInteractionType - Data Layer Version: Version 2
- Name:
DL - AI Interaction Type
- Click Save on both.
Developer Note: Your website’s JavaScript needs to run a command like dataLayer.push({'aiAgentId': 'BrandBot_v2', 'aiInteractionType': 'product_search'}); when it detects an AI agent. This push must execute *before* your main GA4 configuration tag fires, otherwise the data won’t be available for that initial pageview event.
3.2 Create GA4 Event Tags for AI Agent Interactions
Now you’ll set up GA4 to actually capture these data layer variables and turn them into custom dimensions you can use in reports.
- In GTM, go to Tags on the left.
- Click New.
- Tag Configuration:
- Tag Type: Google Analytics: GA4 Event
- Measurement ID: Put in your GA4 Measurement ID (it looks like G-XXXXXXXXX).
- Event Name:
ai_agent_interaction - Under “Event Parameters,” add two rows:
- Parameter Name:
ai_agent_id, Value:{{DL - AI Agent ID}} - Parameter Name:
interaction_type, Value:{{DL - AI Interaction Type}}
- Parameter Name:
- Triggering:
- Choose a trigger that fires on all page views or, even better, a custom event trigger that fires right after your AI agent data is pushed to the data layer. A “Window Loaded” trigger often works well because it gives all the data a chance to be ready.
- Give your tag a name (like “GA4 Event – AI Agent Interaction”) and click Save.
Common Mistake: You have to register these custom event parameters (ai_agent_id and interaction_type) as custom dimensions in your GA4 property’s settings. If you forget this step, the data will get collected, but you won’t be able to see it or use it in any of your reports.
Step 4: Analyze First-Touch Attribution in Google Analytics 4 and Google Ads
Okay, with all the tracking infrastructure built, you can finally start analyzing how AI agents are affecting your first-touch attribution.
4.1 Configure Custom Definitions in GA4
To actually see the AI agent data in your GA4 reports, you have to tell GA4 they exist by registering the custom parameters you’re sending.
- Log in to your Google Analytics 4 property.
- Click the Admin gear icon in the bottom left.
- Under “Data display,” find and select Custom definitions.
- Click the “Custom dimensions” tab.
- Click “Create custom dimension”.
- Dimension name:
AI Agent ID - Scope: Event
- Event parameter:
ai_agent_id
- Dimension name:
- Do it again for
interaction_type:- Dimension name:
Interaction Type (AI) - Scope: Event
- Event parameter:
interaction_type
- Dimension name:
- Click Save for both. You might need to wait up to 24 hours for data to start showing up.
4.2 Report on AI Agent Attribution in GA4
Once data starts flowing in, you can build out custom reports to see what the AI agents are actually doing.
- In GA4, go to Reports > Engagement > Events.
- Find your
ai_agent_interactionevent in the list and click on it. - From here, you can add comparisons or filters using your new custom dimensions like “AI Agent ID” to see which specific agents are firing off interactions.
- For a bigger-picture view, go to Reports > Acquisition > User acquisition or Traffic acquisition.
- Use the primary dimension dropdown and pick “First user source / medium” or “Session source / medium”.
- Now apply a filter to show only sessions that have your AI agent custom dimensions. For example, a filter for “Custom dimension: AI Agent ID contains BrandBot” will isolate all the traffic where that specific AI agent was the first touch.
4.3 Analyze Data in Google Ads Manager
If you passed the custom parameters correctly, you’ll also see insights directly in Google Ads.
- In Google Ads Manager, go to your Campaigns or Ad Groups view.
- Click the Segments button (it’s above the main data table).
- Select “Conversions” > “Conversion action” to see which specific conversions are happening.
- To really see the AI agent impact, you’ll want to build a custom column or report. Go to Columns > Modify columns.
- Under “Custom columns,” make a new one.
- Name:
AI Agent Conversions - Metric: Conversions
- Filter: Add a filter for “Conversion Name” and pick the conversion actions you configured with AI Interaction Signals. You can also try to filter by the
_ai_agent_idcustom parameter if it’s being reported back into Ads correctly.
- Name:
- Another way is, in the main campaigns view, to click Segments > Custom Dimensions. If everything is integrated right, you should see options to segment your data by
_ai_agent_idand_interaction_type. This lets you directly compare how a campaign performs when an AI agent was the first touch versus a regular user.
Being able to segment by these parameters is what lets you make smart calls on bidding and ad copy, tailoring your strategy for AI-driven discovery vs. direct user searches. If you ignore this data, you’re operating with a distorted view of the customer journey and probably wasting huge chunks of your budget.
Tracking AI agent attribution needs regular review and refinement. As AI tech changes and new agents appear, your tracking has to adapt. You have to prioritize consistent naming for your AI agents and make sure your marketing and web dev teams are in sync on the data layer stuff. This diligence is what gives you a clear, actionable picture of your first-touch customer journey and leads to better marketing strategies. For more on how AI is changing PPC, check out the rundown on AI shifts in 2026 campaigns. It’s also worth knowing how to track AI agent conversions by 2026 in GA4 for the full picture. You might also want to read up on the new rules for AI Search PPC in 2026.
So why bother tracking AI agent first-touch attribution?
It helps marketers see how AI-powered discovery tools are affecting initial brand interactions. That insight lets you allocate your budget more accurately, optimize your content so AIs can understand it, and get a clearer picture of the customer journey that goes beyond old-school search engines.
What’s the difference between the _ai_agent_id and _interaction_type custom parameters?
The _ai_agent_id parameter identifies which AI agent started the interaction (e.g., “BrandBot_v2,” “DiscoveryAI”). The _interaction_type parameter describes what it was doing (e.g., “discovery_query,” “comparison_assist,” “feature_highlight”). Used together, they give you a very detailed story about that AI-driven first touch.
How do I make sure my site passes AI agent data to GTM correctly?
Your website’s front-end code (JavaScript) has to be able to spot an AI agent, by its user-agent string, a specific referrer, or some custom parameter, and then immediately push the aiAgentId and aiInteractionType info into the data layer with a dataLayer.push() command. This has to happen before the main GA4 tag on the page fires.
Can I use Google Ads’ auto-tagging with these custom AI parameters?
Yep, Google Ads’ auto-tagging works just fine with custom parameters in your tracking template. Your custom parameters like _ai_agent_id just get tacked onto the end of the auto-tagged URL, so you get both the Google Ads click ID and your own AI identifiers passed to your landing page for full tracking.
What are the reporting challenges with AI agent attribution?
The main headaches are inconsistent AI agent IDs across different platforms, the technical difficulty of dynamically populating your custom parameters, and the fact that you have to keep adjusting things as AI behavior changes. Close collaboration with your developers and regular data validation are the only ways to get past these problems.