How to track Gemini traffic and leads in Google Tag Manager
Short answer: Tag Manager has no report, so you build a label. Add a RegEx Table on {{Referrer}} with a row for gemini\.google\.com|bard\.google\.com that outputs “Gemini”, and put it above any row that matches google, because RegEx Table rows run from top to bottom. Add a URL variable that reads the utm_source query key so tagged Gemini links count too. Then store the label in a cookie so it is still there on the form page. Clicks from AI Overviews and AI Mode come from google.com and can't be split out this way.

Gemini is awkward to label in Tag Manager because it comes from the same company as your biggest traffic source. A click from the Gemini app comes from gemini.google.com, a click from Google search comes from www.google.com, and a click from an AI Overview or AI Mode also comes from www.google.com. A careless pattern labels the first as search, or all three as Gemini.
Step 1: Enable the built-in variables you need
- In your web container, click Variables.
- Under Built-In Variables, click Configure and make sure Referrer, Page URL and Page Path are ticked.
A click on a source link in Gemini on the web usually arrives with a referrer of https://gemini.google.com/. Old shared Bard chats can still come from bard.google.com.
Step 2: Build a RegEx Table, with Gemini above Google
- Under User-Defined Variables, click New and choose RegEx Table. Set the input variable to
{{Referrer}}. - Add the Gemini row first: pattern
gemini\.google\.com|bard\.google\.com, outputGemini. - If you also want a label for ordinary Google search, add it below: pattern
google\., outputGoogle search. - Tick Set Default Value and enter
none. In the advanced settings, untick Full Matches Only, since the referrer is a whole URL.
Order is the whole trick. Google's help page says RegEx Table lookups run from top to bottom, and the first match wins. gemini.google.com contains google., so if the Google row sits on top, every Gemini visit is labelled Google search and the Gemini row never fires. Name the variable AI source.
Step 3: Read the gemini UTM tag as a second signal
Since around 30 September 2026 some links in Gemini answers carry utm_source=gemini. Create a user-defined variable of type URL, set the component to Query and the query key to utm_source, and name it UTM source. On a tagged Gemini click it returns gemini. Treat either signal as Gemini.
The tag matters most for the Gemini mobile apps. App links often arrive with no referrer, so the UTM is the only clue left.
Step 4: Store the label before the visitor moves on
On the second page of the visit the referrer is your own site and the query string is usually gone, so both variables read empty. Add a Custom HTML tag with a page view trigger that fires only when the visit is Gemini (either condition from Step 3), and have it write the label and {{Page Path}} to two first-party cookies. Read them back with two 1st Party Cookie variables, and use those in every tag that fires on a form submission.
Don't clear the cookie on later pages. If you run a consent banner, give this cookie the same consent as your other analytics cookies.
Step 5: Send the label on, then test with a tagged URL
Add the cookie variables as parameters on your GA4 lead or form event and register them as custom dimensions in GA4's Admin or write them into hidden form fields. To test, click Preview and load your site with ?utm_source=gemini on the end of the address. In Tag Assistant, check that UTM source reads gemini and your Custom HTML tag fired, then open a second page and check the cookie variables. To test the referrer row, ask Gemini on the web about your business and click your site in its sources while Preview is running.
What Tag Manager can't see from Gemini
| What the person did | What your tags get |
|---|---|
| Clicked a source link on gemini.google.com | Referrer gemini.google.com, label Gemini |
| Clicked a tagged link in the Gemini app | Often no referrer, but utm_source=gemini in the address |
| Clicked an untagged link in the Gemini app | No referrer and no tag, so the label is none |
| Clicked a source in an AI Overview or AI Mode | Referrer google.com, the same as an ordinary search click |
| Read your name in Gemini, then searched for you | Referrer google.com |
| Read the answer and phoned you | Nothing. No tag fires on a phone call |
The AI Overviews and AI Mode rows can't be fixed in the browser: nothing tells them apart from a normal search click. Our post on tracking Google AI Mode traffic covers that side in Search Console. For the phone row, ask “How did you first hear about us?” on your form and on calls; our guide to wording that question explains why.
Other assistants to add to the same table
Add rows for chatgpt\.com, perplexity\.ai, claude\.ai and copilot\.microsoft\.com, all above any Google or Microsoft search row. ChatGPT also tags links with utm_source=chatgpt.com, covered in ChatGPT traffic in Google Tag Manager; Perplexity sends no tag, covered in Perplexity traffic in Google Tag Manager. Our free AI referral regex generator builds the full pattern, and the general Gemini tracking guide covers GA4.
Gemini leads in Tag Manager with Which AI Sent
Which AI Sent replaces Steps 1 to 5 with one tag. In your dashboard's Setup, click Connect Google Tag Manager and approve on Google's own screen. We add the tag in a new workspace and never publish, so you review it and click Submit; or paste it as a Custom HTML tag on All Pages. Gemini gets its own row, kept apart from Google search, and the script reads both the gemini.google.com referrer and the gemini tag. The source stays with the visitor for 90 days and is attached to their form, and the answer to “How did you first hear about us?” is recorded too, so each AI lead is marked Confirmed, Declared or Assisted. Details are on the Tag Manager integration page.
Gemini traffic in Tag Manager: common questions
Why does Tag Manager label my Gemini visits as Google?
Usually because a row matching google sits above the Gemini row in your RegEx Table. Rows run from top to bottom and the first match wins, and gemini.google.com contains google. Move the gemini.google.com row to the top.
Does Gemini add a UTM tag I can read in Tag Manager?
Some Gemini links carry utm_source=gemini, since around 30 September 2026. Read it with a URL variable set to the Query component and the utm_source query key. Not every link is tagged, so check the referrer too.
Can Tag Manager tell AI Overviews apart from Google search?
No. Clicks from AI Overviews and AI Mode arrive with google.com as the referrer and no special query, the same as a normal search click. Use Search Console's reports for that side.
Does Which AI Sent work with Google Tag Manager?
Yes. Click Connect Google Tag Manager in your dashboard's Setup and approve on Google's screen. The tag is added in a new workspace for you to review and publish, or you can paste it as a Custom HTML tag on All Pages.
See the leads and sales AI sends you
Track AI visits all the way to the lead or sale, and catch the customers who never click. Launch offer: every Pro feature is free until October 31. No card needed.