Help Center
Chatbot integrations

Integration with Google Analytics

Last updated:

ChatLab adds utm_source=aichatbot to supported links in chatbot responses and product cards. You can use this label in Google Analytics 4 (GA4) to investigate visits from those links. It is not an automatic integration that records every chatbot interaction or calculates ROI.

Before You Start

You need access to the destination site's GA4 property, a working Google tag, and a consent setup appropriate for your site. Tracking an external website requires measurement access to that website; its visits will not appear in your own property merely because your chatbot linked to it.

For purchase reporting, your store must send ecommerce events with the relevant transaction information. ChatLab's link label does not install ecommerce tracking for Shopify, WooCommerce, or other platforms. See Google's ecommerce setup guide.

How the Link Label Works

For a simple link:

  • Original: https://yoursite.com/product
  • Chatbot link: https://yoursite.com/product?utm_source=aichatbot

Message links, product-card links, and structured response links use this label. Do not assume every button, form submission, widget opening, or conversation sends a GA4 event.

Inspect the final URL after clicking a link. Existing campaign parameters, URL fragments, or redirects can affect the result. There is no setting in ChatLab for changing the automatic source label.

Check a Link End to End

  1. Open your website and complete the consent flow as a visitor.
  2. Ask the chatbot for a page or product link and open that link.
  3. Check the destination address for utm_source=aichatbot and verify that redirects retain it.
  4. In your GA4 implementation's debugging tools, check that a page-view event is collected with that destination URL.
  5. Repeat with a link that already contains query parameters and with a product-card link if you use ecommerce.

Use ChatLab's Analytics tab for its own chatbot reporting. GA4 data is collected separately and will not necessarily match ChatLab's counts.

Viewing Data in GA4

Traffic Acquisition

Open Reports > Acquisition > Traffic acquisition, if that report is included in your property's report collection. Select Session source and look for aichatbot.

Important: A visitor who opens a chatbot link during an existing GA4 session keeps the original session source. GA4 does not start a new session or change session-scoped acquisition values when new campaign parameters arrive mid-session. Consequently, this report is not a count of all chatbot clicks. See Google's session attribution guidance.

Explore Visits to Tagged Pages

In Explore, create a free-form exploration with Page location and Event count. Filter for event_name = page_view and page locations containing utm_source=aichatbot. This helps you inspect destination page views, not unique clicks: reloads can produce additional views.

Keep user-, session-, and event-scoped dimensions distinct. A first-user source, session source, and event-level campaign source answer different questions. See Google's traffic-source scopes.

Measuring Interactions and Purchases

For a chatbot funnel, define which steps you want to measure: product click, product view, add to cart, and purchase. Implement and validate the missing events in your site or tag manager. Developers can use appropriate Chat API callbacks for widget interactions; UTM parameters alone cannot measure a visitor who chats but never follows a link.

Do not use session_source as though it were an automatically supplied event parameter in a GA4 Create event rule. Build rules from parameters your event actually sends. Keep conversation text, email addresses, phone numbers, and other personal information out of analytics payloads.

Once collection is verified, compare measured chatbot interactions with subsequent key events or purchases using an exploration that matches your question. Treat attributed revenue as a reporting result, not guaranteed incremental revenue or profit. Calculating ROI also requires your costs and an appropriate comparison.

Troubleshooting

  • No tagged visits: Check the actual destination URL, Google tag, consent state, redirects, and collection before investigating reports.
  • Tagged views but no Session source match: The click may have occurred during an existing session.
  • Purchases but no revenue: Check your ecommerce implementation and the purchase event's transaction and value parameters.
  • Counts differ from ChatLab: GA4 and ChatLab measure different events; consent, blocked tags, reloads, and session attribution affect their totals.

For consent-controlled loading, see Setting up privacy consent and load-after-consent.