Skip to main content

analyticsAiReferrals

Returns AI referral session and page-view counts for exactly one site or imported Google Analytics property, recognizing ChatGPT, Claude, Gemini, Perplexity, Microsoft Copilot, and Grok by host or subdomain. Defaults to the previous 30 complete UTC dates and accepts 1 to 60 inclusive dates within available history. Sources without sessions are omitted; the rest sort by sessions descending, then name. Use analytics for all referrers. Requires web analytics view access and access to the source.

analyticsAiReferrals(
siteId: Int
googleAnalyticsPropertyId: Int
startDate: String
endDate: String
): AnalyticsAiReferrals

Arguments​

analyticsAiReferrals.siteId ● Int scalar​

Site ID from sites; supply exactly one of siteId and googleAnalyticsPropertyId.

analyticsAiReferrals.googleAnalyticsPropertyId ● Int scalar​

Imported property ID from gaProperties; mutually exclusive with siteId.

analyticsAiReferrals.startDate ● String scalar​

Inclusive YYYY-MM-DD date; default 30 days before today in UTC. Window must span 1 to 60 dates.

analyticsAiReferrals.endDate ● String scalar​

Inclusive YYYY-MM-DD date; default yesterday in UTC. Site data uses UTC dates; GA uses imported report dates.

Type​

AnalyticsAiReferrals object​

Recognized AI referral counts returned by analyticsAiReferrals for the effective window.