Visoryn
Back to Blog
MeasurementMay 14, 20269 min read

How to connect GA4 to Visoryn for AI search traffic reporting

A step-by-step guide to connecting your website, GA4 property, and Visoryn reader account so you can monitor AI search referral traffic from ChatGPT, Perplexity, Gemini, Claude, and other assistants.

connect GA4 to VisorynGA4 AI search trafficGoogle Analytics 4 setupChatGPT referral trafficAI search referral analyticsGA4 Data API

What the GA4 connection actually does

Connecting GA4 to Visoryn has two separate parts. First, your website needs the Google tag so visits are collected in a Google Analytics 4 web data stream. Second, Visoryn needs read access to the same GA4 property through the Google Analytics Data API. In the current setup, you grant the Visoryn reader Google account access to the GA4 property, then save the numeric Property ID in Visoryn. The website tag sends sessions into GA4; Visoryn reads those sessions and identifies traffic whose source or referrer looks like an AI assistant or AI search engine.

This is not a whole-internet AI search panel. GA4 can only show visits to your own website or app. That makes the report useful for measuring downstream clicks from ChatGPT, Perplexity, Gemini, Claude, Microsoft Copilot, Brave Search, Kagi, You.com, and similar sources after those users land on your site.

Step 1: create or confirm your GA4 web data stream

Open Google Analytics, choose the correct account and GA4 property, then go to Admin and open Data streams. Select the Web stream for your public website, or create one if the site is not connected yet. The stream details page contains the Measurement ID, which starts with G-. That ID is the one used in your website tag.

Be careful not to confuse the Measurement ID with the numeric Property ID. The G- ID connects the website tag to a web data stream. The numeric Property ID is used later by the GA4 Data API and by Visoryn's server-side connection.

  • Use the Measurement ID that starts with G- for the website Google tag.
  • Use the numeric GA4 Property ID when saving the property in Visoryn.
  • Use one GA4 property for the website you want to measure in the Visoryn dashboard.

Step 2: install the Google tag on your website

Install the Google tag on every public page that should be measured. For a direct gtag.js setup, the snippet should load the Google tag script with your G- Measurement ID and call gtag('config', 'G-XXXXXXXXXX'). For Google Tag Manager, configure a GA4 tag that uses the same Measurement ID and fires on page load.

In a Next.js website, the safest implementation is usually to place the tag once in the shared root layout or a central analytics component so every route is covered. After publishing, visit your website in a normal browser session and check GA4 Realtime. If Realtime does not show your visit, Visoryn will not have website traffic to read either.

  • The Measurement ID in your website code must match the web data stream in GA4.
  • The tag should be present on every route that matters, not only the home page.
  • If you use cookie consent, make sure your consent mode still allows analytics collection where legally permitted.

Step 3: find the numeric GA4 Property ID

Visoryn's GA4 Data API connection needs the numeric Property ID, not the G- Measurement ID. In Google Analytics, open Admin, select the correct GA4 property, then open Property settings. Copy the Property ID shown there. It should look like a number, for example 535583363.

This value maps to the API path used by the Google Analytics Data API. If the numeric ID is wrong, Visoryn may authenticate correctly but still read the wrong property or receive a permission error.

Step 4: grant API access with the right Google account

Open Visoryn's AI Search Traffic for GA4 page and copy the reader account shown in the GA4 setup panel. In Google Analytics, open Admin, choose the property, then open Property access management. Add the Visoryn reader account with Viewer or Analyst access. That access lets Visoryn validate the property through the server-side GA4 Data API without asking each user to create their own OAuth client.

Public Google authorization is paused while Visoryn completes Google's verification flow, so the reader-account path is the default setup. Legacy manual OAuth credentials remain available only for local, single-property, or support-guided deployments.

  • Add the Visoryn reader account from the dashboard, not a personal teammate account.
  • Use Viewer or Analyst access so reporting stays read-only.
  • Do not paste OAuth client secrets or refresh tokens unless a support workflow explicitly asks for legacy manual credentials.

Step 5: open the Visoryn GA4 dashboard and check the connection

After the reader account has access, return to Visoryn, go to Resources, and open AI Search Traffic for GA4. Enter the numeric GA4 Property ID in the GA4 access setup panel, then use Verify and save GA4 property. Visoryn validates the Property ID with the GA4 Data API before saving it.

A successful connection does not always mean AI referral traffic already exists. The dashboard may show total sessions while AI Search Referrals remains zero. That usually means GA4 is receiving website traffic, but no sessions in the selected date range matched AI assistant sources yet.

How Visoryn identifies AI search referral traffic

Visoryn groups sessions by GA4 dimensions such as session source, session medium, page referrer, landing page, country, and date. When the source or referrer matches known AI assistant and AI search domains, the session is counted as an AI search referral. The dashboard then shows AI referrals, organic search referrals, total GA4 sessions, AI share, detected engines, countries, landing pages, and trend lines.

This approach is intentionally conservative. It measures clicked traffic that reaches your site, not answer visibility inside an AI assistant. For complete GEO reporting, combine GA4 referral traffic with prompt monitoring, citation tracking, and brand visibility reporting.

Troubleshooting common setup issues

If Visoryn says GA4 is connected but shows no website sessions, start with the website tag. Confirm that the G- Measurement ID is installed on the live website, then visit the site and check GA4 Realtime. If GA4 Realtime is empty, the issue is with collection rather than Visoryn.

If Visoryn returns a permission or authentication error, check the API side. Confirm the numeric Property ID, confirm the Visoryn reader account has Viewer or Analyst access to that GA4 property, and confirm the GA4 Data API can read the property. If you are using a support-guided legacy manual OAuth setup, then the client ID, client secret, and refresh token must all belong to the same OAuth client.

  • No Realtime data in GA4: the website tag is missing, wrong, blocked, or not deployed to every page.
  • GA4 has sessions but Visoryn shows zero AI referrals: AI assistant sources have not sent clicked traffic yet.
  • API permission error: the Visoryn reader account may not have access to the GA4 property.
  • GA4 Property ID error: the dashboard needs the numeric Property ID, not the G- Measurement ID.
  • Legacy invalid grant or unauthorized client: regenerate the refresh token with the current OAuth client only if you are intentionally using manual OAuth credentials.

Next GEO steps

Connect this guide to the rest of the workflow

Resource path

Move from this article into Visoryn's core workflows

Back to the GEO library

FAQ

Common questions

Do I need to connect my website to GA4 before using Visoryn's AI traffic dashboard?

Yes. Visoryn reads website traffic from your GA4 property. If the website is not sending sessions into GA4 through the Google tag or Google Tag Manager, the dashboard will not have traffic data to analyze.

Should I use the G- Measurement ID or the numeric Property ID in Visoryn?

Use the G- Measurement ID on the website tag. Use the numeric GA4 Property ID in Visoryn's GA4 access setup panel after adding the Visoryn reader account to the property.

Why does AI Share show 0% even though GA4 is connected?

AI Share is calculated as AI search referral sessions divided by all GA4 sessions in the selected date range. If GA4 has traffic but no session source or referrer matches an AI assistant domain, AI Share will be 0%.

Can GA4 measure all AI search visibility across the web?

No. GA4 measures traffic that reaches your own website. To understand whether AI engines mention or cite your brand before a click happens, combine GA4 referral reporting with prompt tracking and citation monitoring.