From GA to AI revenue: linking Google Analytics, Matomo and HubSpot to your AI visibility programme
Gustavo De Amorim7 min read

Short answer: treat AI referrals like a channel, tag them at the source, and make them visible in GA4/Matomo and HubSpot with a shared schema. Then prove impact with key events, UTMs, and revenue reports. Below I show exactly how we set this up and what to show stakeholders.
What am I actually trying to measure?
You want to know whether mentions and recommendations from AI assistants drive conversions and revenue. That means capturing: the assistant (e.g., ChatGPT, Gemini, Claude, Perplexity), the prompt intent (e.g., “best payroll software”), and the content that AI cited. Store those as parameters on sessions and conversions so GA4/Matomo can report and HubSpot can attribute to contacts, deals and revenue.
At Luciqo we detect AI recommendations, the assistants referenced, and their citations. We then pass that context so you can analyse it in your stack. If you don’t have a detector, you can still approximate with UTMs and form fields; I’ll show both. (See also: How to track AI recommendation share and Which sources do assistants prefer).
How should I design events and parameters?
Design once and reuse across tools.
- Event: ai_recommendation_viewed (non-PII)
- Parameters: assistant_name, prompt_text_hash, prompt_topic, cited_domain, cited_url_hash, recommendation_rank
- Event: ai_clickthrough (when a user lands from an assistant or from content seeded to be quoted)
- Parameters: assistant_name, prompt_topic, cited_domain, landing_section
- Key conversion (GA4) / Goal (Matomo) / Form submission (HubSpot): lead_submitted, demo_booked, checkout_completed
- Parameters: assistant_name, prompt_topic, cited_domain
In GA4, custom parameters only appear in reports if you register them as custom dimensions/metrics; use recommended events where possible and add parameters for your AI context (Google’s guide).
In Matomo, attach AI context with Custom Dimensions. Choose “Visit” scope for session-level (assistant_name, prompt_topic) and “Action” scope for hit-level (cited_domain). Matomo limits visit/action custom dimensions per site; plan naming up front (Matomo docs and FAQ on limits) (FAQ).
What UTM strategy should we use for AI referrals?
Use normal UTMs and reserve a source and medium convention for AI.
- utm_source: the assistant or aggregator (chatgpt, perplexity, gemini, claude, copilot)
- utm_medium: ai_referral (for direct assistant clicks), ai_content (owned pages designed to be quoted), ai_outreach (earned placements you seeded for AI to cite)
- utm_campaign: prompt_topic or buying job (e.g., payroll_eval_q4)
- utm_content: optional variant (prompt cluster, template, or angle)
If you build links in HubSpot, its tracking URL builder persists the UTMs and maps Campaign automatically (HubSpot KB). In GA4, UTMs populate acquisition reports by default (GA Help: URL builders).
Tip: if you don’t control the link (e.g., an AI panel), use landing pages with canonical UTMs and server-side rules to ensure UTMs are present on redirects.
How do I capture AI context in GA4?
Two routes work well:
- Client-side via Tag Manager
- Add a GA4 Event tag for ai_clickthrough on pageview if a querystring contains your ai_referral markers; pass assistant_name from utm_source and prompt_topic from utm_campaign.
- Register assistant_name and prompt_topic as custom dimensions in GA4 admin so they appear in reports (event parameters → custom dims).
- Server-side or backend
- If using a server container or backend logging, include the same parameters on the event payloads. Keep names consistent with UTMs to avoid translation layers.
Use GA4’s “key events” for lead_submitted, demo_booked, checkout_completed, then inspect Path/Model comparison with those parameters as breakdowns. GA4’s attribution offers data-driven, cross-channel rules in its Attribution reports (GA Help).
How do I capture AI context in Matomo?
- Create Custom Dimensions: Visit scope (assistant_name, prompt_topic) and Action scope (cited_domain).
- Set the Visit dimensions before trackPageView. Action dimensions can be set just before sending the event or page view (Matomo JS tracking guide).
- Be aware of default dimension quotas and plan a measurement standard (Matomo Measurement Plan PDF).
How should we wire HubSpot so revenue ties back to AI?
HubSpot sets traffic source properties on contacts automatically and exposes “Original” and “Latest” source plus two drill-down fields. UTM values feed those drill-downs for channels like Email and Other Campaigns. You can segment, trigger workflows, and build custom reports from these properties (HubSpot KB on traffic source properties and using them in reports).
Practical steps
- Ensure your site has the HubSpot tracking code on every page and domains are configured so your own sites don’t show as referrers (HubSpot blog guidance).
- Standardise UTMs. Build links in HubSpot or your own generator so utm_source=assistant and utm_medium=ai_referral are consistent (HubSpot tracking URLs).
- Add hidden form fields to capture UTMs and assistant_name on submission for redundancy. Map them to custom contact properties if you want the literal values alongside HubSpot’s derived source fields.
- Associate contacts to deals automatically via workflows so revenue rolls up to the same source dimensions.
Note: HubSpot lets you edit Original Source in some cases, but not its drill-down values. That prevents rewriting UTMs after the fact, which is good for governance (HubSpot: editing Original Source).
What are the attribution caveats I should flag to stakeholders?
- GA4 models: Data-driven attribution (DDA) is default in many reports and distributes credit based on the observed impact of each interaction. Don’t compare it directly to last non-direct from legacy dashboards without context (GA Help: Attribution).
- HubSpot sources: “Original” vs “Latest” tell different stories. Align the question (what first created the contact vs what touched it recently) before declaring winners (HubSpot KB).
- Matomo quotas: Custom dimension limits mean you should keep AI fields few and reusable (Matomo FAQ).
- UTM hygiene: mixed naming breaks aggregation. Use a controlled list and don’t rely on utm_term unless you truly have paid keyword data mapped. GA4 recognises standard UTM parameters in acquisition reports (GA Help).
What dashboards prove ROI in a board meeting?
Build three concise views and keep labels human.
- AI visibility → web impact (GA4/Matomo)
- Chart: Sessions and key events where assistant_name is not null.
- Table: assistant_name x prompt_topic with key events and conversion rate.
- Note under the chart: “Attribution shown: GA4 data-driven (model compare tab available).” (GA Help).
- AI-sourced pipeline (HubSpot)
- Report: Deals amount (Closed-won) by Original source drill-downs where utm_medium contains ai_.
- Slicer: assistant_name (custom contact property) and prompt_topic.
- QA: spot check contact timelines for the AI clickthrough before first form submit (HubSpot KB on using source fields).
- Content that AI cited and that converted (Luciqo + GA4/Matomo)
- Table: cited_domain and owned URL that received traffic, with key events.
- Insight: if conversions come from third‑party citations, prioritise outreach to those domains. Luciqo surfaces which sources assistants cite most so you can act on that pattern (https://luciqo.ai).
What does a minimal viable setup look like in 2 weeks?
- Agree schema: assistant_name, prompt_topic, cited_domain, recommendation_rank.
- Implement UTMs: utm_source=assistant, utm_medium=ai_referral, utm_campaign=prompt_topic.
- GA4: create custom dimensions for assistant_name and prompt_topic; mark key events; build an Exploration with breakdowns. (GA4 event parameters doc).
- Matomo: add Visit and Action custom dimensions; set values before trackPageView and on events; create a Custom Report by dimension. (Matomo JS guide).
- HubSpot: enable tracking URLs; add hidden UTM fields to forms; create contact and deal reports filtered to ai_referral mediums. (HubSpot tracking URLs and source properties).
If you want a deeper strategy for earning citations that assistants trust, read: Optimising for AI product discovery and GEO Writer checklist.
What’s next?
- Instrument the schema and UTMs this week.
- Ship the three dashboards next week.
- Review monthly: which assistant + prompt_topic combinations move revenue, which cited domains matter, and what to publish or pitch next.
If you’d like to see how we at Luciqo detect AI recommendations, stitch them to GA4/Matomo, and attribute revenue in HubSpot, start here: https://luciqo.ai.
Frequently asked questions
What GA4 settings do I need for AI parameters to show up?
Register each custom event parameter (e.g., assistant_name, prompt_topic) as a custom dimension/metric in GA4 Admin. Otherwise values won’t appear in standard reports. See Google’s event parameter docs.
How many custom dimensions can I use in Matomo?
Matomo provides limited Visit and Action custom dimensions per site by default. Plan names and scopes carefully and reuse fields. See Matomo’s Custom Dimensions FAQ.
How does HubSpot use UTMs in source reporting?
HubSpot sets Original and Latest traffic source on contacts and fills drill-downs from UTMs for some channels. You can segment and build reports from these properties. See HubSpot KB.
What attribution model should I show to the board?
Use GA4’s data-driven attribution in the executive view. Keep a model comparison tab handy to answer “what if last-click?” without changing the headline.
What if an AI platform strips or changes my UTMs?
Use canonical landing URLs with server-side rules to append/normalise UTMs. Add hidden form fields and a session storage script so the values persist to submission.
How do I link AI citations to on-site conversions?
Track ai_clickthrough with assistant_name and cited_domain, register parameters in GA4/Matomo, and join to key events. In HubSpot, map these to contact properties and report revenue by those fields.
Keep reading

2 November 2026
How to track AI recommendation share and competitors that assistants suggest instead of you

4 June 2026
From Data to Decisions. Why Great Analytics Starts with the Right Business Question

28 May 2026
Why Fragmented Marketing Data Is Holding Businesses Back and How Luciqo AI Turns It Into Action
See what AI says about your brand
Start with a free snapshot: 10 buyer questions, four AI assistants, results in minutes. No card needed.