Independent directory. Every listing is checked against the agency’s own website. How we vet agencies

Guides

How to Track AI Referral Traffic for Medical Practices

Doctor consulting patient in modern office

To track AI referral traffic for a medical practice, build a custom channel group in GA4 called “AI Assistants.” Its one rule matches the session source against chatgpt, perplexity, gemini.google, copilot.microsoft and claude.ai. Then move that channel above Referral so GA4 sorts those visits first. After that, check server logs for AI user agents and keep every tag off pages that carry patient data.

We researched the official help pages from Google, OpenAI, Anthropic and Perplexity for this guide. We also read the HHS guidance on tracking tools and Google’s own HIPAA note for Analytics. So every setting, user agent and rule here comes from the company that owns it.

Check Six Facts Before You Read the AI Numbers

  • A standard GA4 property allows 2 custom channel groups, each with up to 50 channels.
  • GA4 regex is a full match and case sensitive by default, so wrap the pattern in .* on both sides.
  • Channel order decides where a session lands, so the AI channel must sit above Referral.
  • ChatGPT adds utm_source=chatgpt.com to the links it sends, which makes its visits the easiest to spot.
  • Server logs show ChatGPT-User, Perplexity-User and Claude-User fetches that never reach GA4.
  • Google offers no business associate agreement for Analytics, so tags stay off portal, booking and symptom pages.

Look for AI Visits Your Reports Already Hold

Open Reports, then Acquisition, then Traffic acquisition. Next, switch the main dimension to “Session source” and type “chatgpt” in the search box. Repeat the search for “perplexity,” “gemini,” “copilot” and “claude.” If rows appear, note whether GA4 filed them under Referral or Unassigned.

Those scattered rows are the reason for a custom channel. In the default setup, AI visits mix with links from directories, hospitals and local news. As a result, nobody can tell whether AI answers send more patients this quarter than last.

Patients do use these tools. KFF polled 2,428 US adults from June 3 to 24, 2024. Of those, 17% said they used AI chatbots at least once a month for health information or advice. Among adults aged 18 to 29, the share was 25%.

How US Adults Use AI and AI Chatbots for Health Information
How US Adults Use AI and AI Chatbots for Health Information. Chart: Medigencies. Source: KFF Health Misinformation Tracking Poll on AI and health information

Still, trust is low. In the same poll, 56% of AI users said they were not confident in the accuracy of AI health answers. So a patient who clicks from ChatGPT to your page is often checking the answer. That click deserves its own line in your reports.

A nurse typing on a keyboard while sitting
Photo: Pexels

Create an “AI Assistants” Channel Group in GA4

Go to Admin, then Data display, then Channel groups. Click “Create new channel group.” GA4 copies the default group, so every existing channel stays in place and you only add one. You need the Editor role or higher at the property level to do this.

Google Analytics Help page on custom channel groups, with the Admin path, channel limits and ordering rules
Screenshot: support.google.com

Name the group something your team will recognize, such as “Practice Channels.” Then click “Add new channel” and call it “AI Assistants.” A standard property allows 2 custom groups and 50 channels per group. A 360 property allows 5 custom groups.

Write One Regex for the Five Assistant Domains

Add a condition, choose “Source,” then choose “matches regex.” Paste this pattern.

.*(chatgpt|openai|perplexity|gemini\.google|copilot\.microsoft|claude\.ai).*

GA4 treats regex as a full match by default. Google’s own example shows “San Francisco” matching only that city, while “.*San Francisco.*” also catches “South San Francisco.” So the .* on each side lets the pattern catch subdomains and longer source names.

Google Analytics Help page explaining that GA4 regular expressions are full match and case sensitive by default
Screenshot: support.google.com

We chose each part for a reason. For example, “chatgpt” and “openai” cover chatgpt.com and the older chat.openai.com address. Also, “gemini\.google” skips unrelated sites that use the word Gemini. The backslash before each dot makes it a literal dot in the pattern.

AssistantSource you will see in GA4Part of the pattern that catches it
ChatGPTchatgpt.com (older visits: chat.openai.com)chatgpt, openai
Perplexityperplexity.aiperplexity
Google Gemini appgemini.google.comgemini\.google
Microsoft Copilotcopilot.microsoft.comcopilot\.microsoft
Claudeclaude.aiclaude\.ai
Medigencies regex map for a GA4 AI channel. Add new assistant domains as they appear in your Session source report.

Channel definitions in GA4 are not case sensitive, per Google’s channel group help page. Even so, we keep the pattern lower case, because that matches how GA4 shows source values.

Drag the AI Channel Above Referral

Google states that traffic goes into the first channel whose rule it matches. A ChatGPT click with a referral medium would therefore land in Referral if Referral comes first. So click “Reorder” and move AI Assistants above Referral, Organic Search and Unassigned.

Then save. Custom channel groups apply to your reports retroactively, so last year’s AI visits move into the new channel too. However, audiences built on the channel only update from the save date forward.

Test the Channel With a Free-Form Exploration

Open Explore and build a free-form table. Put your new channel group in rows and “Session source” next to it. Every row under AI Assistants should be an assistant domain. If a stray source slips in, tighten that part of the pattern and save again.

Next, look at the Unassigned row for any AI source left behind. For instance, a visit tagged with utm_source but no utm_medium can fall outside the default rules. A source-only rule catches it whatever the medium says.

Read UTM Tags Knowing Where They Stop

OpenAI’s publisher FAQ says ChatGPT automatically adds utm_source=chatgpt.com to the links it shows in search results. As a result, many ChatGPT clicks carry their source even when the browser drops the referrer. The same FAQ asks sites to allow OAI-SearchBot in robots.txt if they want to appear in ChatGPT search.

Other assistants do not publish the same promise in their help pages. So their clicks depend on the referrer header. When a click arrives with no referrer and no UTM tag, GA4 files it under Direct. That is why the AI channel shows a floor of AI visits. The true number sits somewhere above it.

You also cannot tag links you did not place, because an AI tool picks your URL from its own index. So the channel group, the server logs and a question on the intake form carry the rest of the work.

SignalWhat it provesWhere it falls short
utm_source=chatgpt.comThe click came from a ChatGPT answerCovers ChatGPT only
Referrer headerThe browser passed the AI site’s addressApps and privacy settings can strip it
Your own UTM codesA click came from a link you placedSays nothing about links AI tools chose
Direct trafficA session with no source dataHides some AI clicks among typed visits
Medigencies summary of attribution signals, built from OpenAI’s publisher FAQ and Google Analytics Help.

Count AI Fetches in Your Server Logs

GA4 runs in a browser, so it never sees an AI tool reading your page. Your web server does. Each AI company names its agents, and each agent shows up in the user-agent field of your access log.

User agentCompanyWhat it does, per the company
ChatGPT-UserOpenAIVisits pages for actions a user starts in ChatGPT or a Custom GPT
OAI-SearchBotOpenAIFinds pages to show in ChatGPT search
GPTBotOpenAICrawls content that may train OpenAI’s models
Perplexity-UserPerplexityVisits a page when a user’s question needs it
PerplexityBotPerplexityFinds and links sites in Perplexity results
Claude-UserAnthropicFetches pages when Claude users ask questions
Claude-SearchBotAnthropicImproves the quality of Claude search results
ClaudeBotAnthropicCollects content that may train Anthropic’s models
Source: OpenAI crawler overview, Perplexity crawler documentation and Anthropic’s crawler help article.
OpenAI crawler overview listing OAI-SearchBot, GPTBot and ChatGPT-User with their user-agent strings
Screenshot: developers.openai.com

The “-User” agents matter most for a practice. Each one means a real person asked an AI tool something, and the tool opened your page to answer. In fact, OpenAI and Perplexity both say these user-started visits may not follow robots.txt rules.

Anthropic help article describing ClaudeBot, Claude-User and Claude-SearchBot
Screenshot: support.claude.com

Ask your host or IT team for a monthly count by agent and URL. On a Linux server with a standard access log, one command does it.

grep -E "ChatGPT-User|Perplexity-User|Claude-User" access.log \
  | awk '{print $7}' | sort | uniq -c | sort -rn | head -20

The output lists your 20 most-read pages by AI tools on behalf of users. Then compare that list with the landing pages in your AI channel. A page that AI tools read often but patients rarely click may need a clearer answer near the top.

Keep one caution in mind. Anyone can copy a user-agent string, so treat these counts as estimates. Also, access logs hold IP addresses and full URLs. For that reason, we strip query strings and keep logs with a host that has signed a business associate agreement.

Keep AI Tracking Off Pages That Hold Patient Data

Google states that it does not offer business associate agreements for Google Analytics. Its HIPAA help page says authenticated pages are likely HIPAA-covered, and customers should not tag them. It adds that unauthenticated pages tied to providing care are more likely covered too.

Google Analytics Help page on HIPAA stating that Google does not offer business associate agreements for Analytics
Screenshot: support.google.com

The HHS Office for Civil Rights bulletin on tracking technologies draws similar lines. It says HIPAA applies when tracking captures data from appointment scheduling, symptom checkers or a portal login page. On the other hand, general pages such as visiting hours or job posts usually give trackers no PHI.

A court has since changed part of that bulletin. On June 20, 2024, a federal court in Texas vacated one section. That section said an IP address plus a visit to a public condition page triggers HIPAA. HHS now shows that note at the top of the bulletin. Even so, the rest of the guidance stands, so we treat it as the working rule.

In practice, the AI channel needs only page-level data. It never needs a patient’s name, condition or appointment. So we recommend these rules for every practice site.

  • Put the GA4 tag on public education, location and doctor pages only.
  • Remove it from the portal, booking flow, intake forms and any symptom checker.
  • Name key events by page type, such as “consult_page_view,” and leave out condition names.
  • Send form data to a vendor that signs a business associate agreement.
  • Ask your privacy officer or counsel to approve the tag map before launch.

Ad pixels raise the same questions, and Google Ads adds its own health rules. Our guide to Google’s healthcare ad rules covers that side.

Split Google AI Overview Clicks From Chatbot Clicks

Clicks from Google’s AI Overviews and AI Mode do not show up as a separate source in GA4. Instead, they arrive as google / organic, the same as a blue link. Google reports them inside the Search Console Performance report, under the Web search type.

Google Search Central page on AI features such as AI Overviews and AI Mode and how websites appear in them
Screenshot: developers.google.com

Google also announced Search generative AI performance reports for Search Console in June 2026. If your property shows them, add those numbers to the same monthly sheet. Keep them in their own row, though. Your GA4 AI channel counts chatbot clicks, while Search Console counts Google’s own AI features.

To get cited in Google’s AI features, read our cataract surgery center SEO guide and med spa SEO guide for page setup by specialty.

Study the Pages AI Tools Send Patients To

Open the Landing page report and add a filter for your AI Assistants channel. Then sort by sessions. The top rows tell you which questions AI tools answer with your content.

Next, compare those pages with pages that already do this well. We picked three public healthcare pages that put a direct answer in plain view. Each one shows a pattern a practice can copy.

First, Cleveland Clinic’s cataract surgery page uses question subheads with a short answer under each one. It also carries a medically reviewed label. An AI tool can lift any single answer without losing the meaning.

Cleveland Clinic cataract surgery page with question subheads, short answers and a medically reviewed label
Screenshot: my.clevelandclinic.org

Second, LaserAway gives each patient question its own URL, such as how long laser hair removal lasts. So when an AI tool cites the answer, the click lands on the exact question. Then your landing page report shows which question drew the visit.

Third, Cleveland Clinic’s cardiac surgery outcomes page lists ratings with their data periods. Dated facts like these give AI tools something specific to quote. Also, a patient who wants to check a number has a reason to click.

Cleveland Clinic cardiac surgery outcomes page listing ratings with data periods
Screenshot: my.clevelandclinic.org

After that, check the engagement rate and key events for each AI landing page. A page with many AI sessions but few consult clicks may answer the question and stop there. For instance, a short “book a consult” line under the answer gives the reader a next step.

Report AI Referrals to the Practice Every Month

Pull the same seven numbers on the same day each month. Then compare each one with the month before and the same month last year. Small monthly counts swing a lot, so trends over three months tell you more than any single month.

LineWhere it comes fromThis monthLast month
AI Assistants sessionsGA4 custom channel group
AI share of all sessionsAI sessions ÷ all sessions
Sessions by assistantGA4 exploration, Session source
Top 5 AI landing pagesGA4 Landing page report, AI filter
Consult page views from AI visitsGA4 key events
“-User” agent fetchesServer access log
Google AI feature clicksSearch Console
Medigencies monthly AI referral report template for medical practices.

The share line needs one division. For example, 60 AI sessions out of 5,000 total sessions is 1.2%. If the next month shows 90 out of 5,000, the share rises to 1.8%. Those figures are an illustration of the math only, so plug in your own.

Finally, connect the report to the front desk. Ask new patients how they found you and add “AI assistant” as a choice on the intake list. Patient answers can catch some of the visits that GA4 files as Direct.

If you want outside help, our directory lists healthcare AEO and GEO agencies and healthcare SEO agencies. For a wider look at tracking software, see our review of healthcare SEO tools.

Answer Practice Managers’ Questions About AI Referral Data

Why Does ChatGPT Traffic Show Up as Unassigned or Direct?

Unassigned means no default channel rule matched the visit’s source and medium. Direct means the click arrived with no referrer and no UTM tag. A source-based AI channel fixes the first case. The second case only shows up through patient surveys and server logs.

Can a Practice Use GA4 Under HIPAA at All?

Google says it makes no claim that Analytics meets HIPAA and offers no business associate agreement. It advises regulated customers to use GA4 only on pages that are not HIPAA-covered. So many practices keep GA4 on public pages and work with counsel to map which pages qualify.

Should We Block GPTBot or ClaudeBot?

Those two crawl for model training. Blocking them in robots.txt does not stop the search and user agents, because each company names those separately. However, OpenAI asks sites to allow OAI-SearchBot if they want to appear in ChatGPT search.

How Many Custom Channel Groups Can One Property Have?

A standard GA4 property allows 2 custom channel groups next to the default one. A 360 property allows 5. Each group holds up to 50 channels, so one group can carry AI Assistants and your other practice channels.

Do AI Overview Clicks Count in the AI Assistants Channel?

No. Those clicks come from google.com, so GA4 counts them as organic search. Track them in Search Console instead. Keeping the two apart stops you from crediting ChatGPT for visits that Google sent.

Multi-location groups often want an agency to build this setup. Our medical practice marketing agencies list shows firms by specialty, and the get matched form sends your brief to a short list. Our post on AI agents in healthcare marketing covers the other side of AI at a practice.

Compare Agencies for This Topic

Digital Health and Healthtech Marketing AgenciesMedical Practice Marketing AgenciesHealthcare AEO and GEO AgenciesHealthcare SEO Agencies

More From the Blog

Statistics

Healthcare Mobile Search Statistics

Smartphone ownership, online health lookups by age, portal app use, telemedicine and page speed limits, with our own per-1,000-adults model for clinics.

Nov 5, 2026

Statistics

Healthcare Digital Marketing ROI Statistics

Hospital ad effects, health system marketing budgets, cost per patient by channel and Google's return claim, with our own math for clinics and hospitals.

Nov 5, 2026