Skip to content
Luciqo

From query to conversion: linking AI recommendation events to HubSpot and GA4 revenue

Gustavo De Amorim7 min read

Short answer: treat “AI recommended us” as a first‑class marketing touchpoint. Capture it with a consistent event schema, push it to HubSpot and GA4 (server‑side), join it to deals and purchases, and report its incremental revenue in attribution and cohort views.

Below I show the event model, what to record in Luciqo, how to post to HubSpot/GA4, and two clean ways to report lift.

What exactly is the “AI recommendation” event?

It’s a user’s disclosed moment of influence: “I found you because ChatGPT/Claude/Gemini/Perplexity recommended you.” Log it as a touchpoint close to the session where the user lands on your site or contacts sales. At Luciqo we standardise it as ai_recommendation with required context:

  • assistant: chatgpt | claude | gemini | perplexity
  • query_type: comparison | shortlist | how_to_buy | alternative_to_X
  • surface: web | mobile | plugin | search_overview
  • cited_source: url domain (if the assistant exposed it)
  • evidence: free text or copy of the assistant’s answer ID/screenshot hash
  • link_ref: campaign/UTM that brought them here (if any)
  • ids: ga4_client_id (user_pseudo_id), user_id (if signed in), hubspot_contact_id or email

Capture once per meaningful disclosure (e.g., on your “How did you hear about us?” step or chat playbook) and server‑side post it within seconds.

What should I capture in Luciqo before pushing downstream?

Minimum viable fields to make revenue joinable and auditable:

  • event_name: ai_recommendation
  • occurred_at: ISO timestamp (UTC)
  • assistant, query_type, surface, cited_source
  • session identifiers: ga4_client_id (or web user_pseudo_id), session_id (if available) — needed to avoid “(not set)” sessions in GA4 when you use Measurement Protocol. Include session_id when you have it. Google help.
  • user identifiers: user_id (if authenticated), email (hash if policy requires), hubspot_contact_id (if known)
  • dedupe key: recommendation_event_id to prevent double posting
  • evidence pointer: storage location of the AI answer/screenshot

We also store the GA4 stream ID and Measurement Protocol API secret so we can push cleanly. MP requires api_secret and allows user_id, timestamp_micros and event payloads. GA4 MP reference.

How do I push the event to GA4?

Use GA4 Measurement Protocol (server‑side). Send an event called ai_recommendation with useful parameters, and pass user_pseudo_id (the GA4 client ID), optionally user_id if authenticated. Include session_id when you have it to link the server event to the user’s session.

Example payload (trimmed):

  • POST https://www.google-analytics.com/mp/collect?measurement_id=G-XXXX&api_secret=YYYY
  • body { "client_id": "1234.5678", "user_id": "user-42", "timestamp_micros": 1733134800000000, "events": [{ "name": "ai_recommendation", "params": { "assistant": "chatgpt", "query_type": "comparison", "surface": "web", "cited_source": "example.com", "session_id": 169992, "value": 0 } }] }

Notes

  • Don’t collide with reserved names; GA4 blocks some event and parameter names. Reserved names.
  • If you later want to attribute revenue, you’ll either connect this touchpoint to a purchase event (with transaction_id, value, currency) or to your CRM deals in BigQuery. GA4 purchase parameters.

How do I push the event to HubSpot?

Use HubSpot Custom events. Create a definition (assistant, query_type, cited_source, surface, evidence_id), then send event completions via API with the contact identifier (email or contact ID). Custom events appear on the contact timeline and can be used in attribution. HubSpot custom events setup.

HubSpot notes

  • Custom events are first‑class objects with properties, editable via API (recent updates renamed CBEs to Custom events and exposed definition APIs). Product update summary.
  • They can be analysed in HubSpot’s attribution reports. Processing can take up to two days on existing reports. Attribution docs.

How do I keep this compliant in the UK/EEA?

Implement Google Consent Mode v2 on site so GA4 respects consent signals. This has been required for ad personalisation/measurement since early March 2024; upgrade if you haven’t. Google consent reference and Analytics help note on strengthened enforcement.

For server‑side events, avoid sending personal data to GA4. Use user_pseudo_id/client_id and your own user_id only if it’s non‑PII and contractually allowed. Store any raw evidence in your systems, not in analytics payloads.

How do I report revenue from AI recommendations in GA4?

Two routes work well:

  1. In‑platform attribution
  • Mark purchase as your key event and keep GA4 on data‑driven attribution (default since late 2023). Use the Attribution > Model comparison to compare data‑driven vs paid & organic last‑click — AI recommendation should contribute earlier‑path credit. GA4 attribution overview and model change history.
  • In Explorations, break down key events by the presence of ai_recommendation in the path (requires BigQuery or custom dimensions if you need pathing). BigQuery export is free for GA4; remember BigQuery storage/query costs. Export setup and reporting playbook note on costs.
  1. Join in BigQuery for precision
  • Export GA4 to BigQuery (daily or streaming), export your HubSpot deals, then join on user_id/email (hashed) or via a visitor‑to‑contact key. Attribute revenue to the earliest ai_recommendation per user within a 90‑day lookback, or use a position‑based rule you define. Google documents that only three reporting attribution models remain in GA4 (data‑driven, paid & organic last‑click, Google‑paid last‑click), so custom models belong in BigQuery. Model availability and Google’s note removing legacy models.

How do I measure incrementality (not just attribution)?

Attribution tells you “who gets credit.” Incrementality asks “what changed because assistants recommended us?” Use one of:

  • Switchback cohorts: alternate weeks tagging Luciqo‑optimised content in GEO across categories, then compare revenue from users with an ai_recommendation touchpoint vs similar users without, controlling for channel mix.
  • Geography or segment holdouts: suppress outreach to a holdout industry/region while you continue GEO content everywhere else; compare the share of deals where ai_recommendation appears.

You’ll still report inside GA4/HubSpot, but the experiment design and evaluation live in BigQuery/BI. Keep the uplift estimate separate from attribution credit.

What reports do I build in HubSpot?

If you’re on Marketing Hub Enterprise, use Revenue attribution reports and include your custom “AI recommendation” event as an interaction. Build two dashboards:

  • AI‑influenced revenue: revenue by assistant, query_type, cited_source
  • Pipeline quality: average deal size and win‑rate when ai_recommendation exists vs not

HubSpot’s attribution report types and models are documented here; you can choose revenue attribution and pick the model that fits stakeholder expectations. Create attribution reports and model notes.

Implementation checklist (copy/paste)

  • Map your event schema (assistant, query_type, surface, cited_source, evidence_id)
  • Add a capture point (“How did you hear about us?” + AI options) to forms/chat
  • Store ai_recommendation in Luciqo with ids (client_id, user_id, contact/email)
  • Post to GA4 via Measurement Protocol; include client_id and, when possible, session_id; avoid PII
  • Define HubSpot Custom event and send completions with contact identifier
  • Enable GA4 BigQuery export; schedule HubSpot → warehouse sync
  • Build GA4 model comparison and HubSpot revenue attribution reports
  • Design a basic incrementality test (switchback or holdout) in your BI layer
  • Document consent and retention; upgrade to Consent Mode v2 where applicable

Where Luciqo fits

Luciqo monitors whether assistants recommend you, which competitors they suggest instead, and which sources they cite — and records those “AI recommendation” events so you can send them to GA4/HubSpot and tie them to revenue. If you’re starting from scratch, these two posts will help: What to change on your website now that generative AI is the default for search and From GA to AI revenue: linking Google Analytics, Matomo and HubSpot to your AI visibility programme.

Next steps

  • Define your ai_recommendation event and deploy one capture point this week
  • Wire the GA4 MP and HubSpot Custom event calls server‑side
  • Turn on GA4→BigQuery and schedule a weekly AI revenue review
  • After four weeks, run a simple uplift read on AI‑influenced cohorts

If you want a starting template or sample payloads, ping me — we at Luciqo share a lightweight reference implementation that plugs straight into GA4, HubSpot and BigQuery.

Frequently asked questions

client_id (user_pseudo_id), optionally user_id, timestamp_micros, and session_id when available; plus a dedupe key and clear event params. See Google’s Measurement Protocol docs.

How do I avoid “(not set)” for sessions when sending server‑side?

Send a valid session_id captured from the client to Measurement Protocol so GA4 can stitch to the session.

Which GA4 attribution models are available in 2026?

Data‑driven (default), Paid & organic last click, and Google‑paid last click. Legacy models were removed.

Do HubSpot Custom events work in revenue attribution reports?

Yes. Custom events appear on timelines and can be included in HubSpot attribution, including revenue attribution in Marketing Hub Enterprise.

Is BigQuery export free for GA4?

Linking GA4 to BigQuery is free; BigQuery storage and query usage can incur costs.

Implement Consent Mode v2 and ensure analytics/ad uses comply with Google’s strengthened EU user consent policy from March 2024.

See what AI says about your brand

Start with a free snapshot: 10 buyer questions, four AI assistants, results in minutes. No card needed.