Help

Overview Admin Chat Data Sync Upload Documents Search Settings Curated Answers Agents, Prompts & Functions Contact Support

Service Configuration Analytics

Airgentic Help

The Analytics tab of Service Configuration controls analytics integrations, optional durable chat sessions, and an optional external person identifier for Insights and CRM.


Google Tag Manager Analytics

Push structured chatbot events to window.dataLayer on your website so your GTM container can forward them to GA4 or other analytics platforms.

Setting Description
Enable GTM dataLayer tracking Master switch for the integration. Off by default.
Include question and answer text Privacy-sensitive opt-in. Adds user questions and assistant answers to analytics events. Only available when GTM tracking is enabled.

Both settings are stored in your service configuration as analytics.gtm_data_layer_enabled and analytics.gtm_include_conversation_data.

See Google Tag Manager Analytics for event schema, GTM setup guidance, and verification steps.


Lead conversion

Count a visit as converted when any of the events you list happen. The first match wins and is recorded once per visit. An empty list turns the feature off.

Event When it counts
Escalated to a human The visitor is handed off from AI to a human advisor (request_human_assistance, an explicit “talk to a human”, or auto-escalation). Recorded when assistance is requested, not when an advisor later claims the chat.
Delegated to agent The router selects the specialist you name for the turn.
Agent called function The named function finishes without error (for example capture_lead).
Synced to CRM Visitor-profile CRM sync actually wrote (HubSpot/Marketo or your custom sync function).
Email captured A real visitor email is stored on the profile (not a placeholder used as a CRM key).

The first matching event is stored on Insights as converted plus conversion_event (for example human_handoff or function_called:capture_lead). Later matching events in the same visit do not change that value and do not fire GTM again.

Insights and GTM are independent. Conversion rules can run with GTM off; enabling GTM with an empty conversion list does not invent conversions. When GTM is on, the widget pushes chat_action: "lead_converted" once while the websocket is still open. Voice, Twilio, and WhatsApp visits still stamp Insights; they have no host-page dataLayer.

Notes:

  • Services that start in human-only mode (AI disabled) do not count as Escalated to a human. Escalation is a transition from AI handling to a human request.
  • Email captured as a conversion event is separate from the Insights Email captured filter, which reports whether a real email was captured regardless of conversion rules.
  • Test and admin traffic is excluded the same way as other Insights records.

Stored as analytics.conversion_events in your service configuration.


Persist chat across page loads

By default, each page load starts a new conversation. Turn this on when you want returning visitors on the same browser to continue where they left off after a refresh or navigation.

Setting Description
Restore the conversation after a refresh Master switch. Off by default.
Keep the conversation for (hours) How long the conversation id is kept in a first-party cookie (1–168 hours, default 24). Only editable when persist is enabled.

When enabled, the widget stores the conversation id in a first-party cookie on your domain (et_session_id_<account>_<service>) and sends it back to Airgentic on the next visit. The server restores the visitor-visible transcript in the chat window.

Notes:

  • No extra script attribute is required.
  • The cookie is first-party on your site (the widget iframe is written from the host page).
  • Visitors who return after the configured hours, or with cookies cleared, start a new conversation.
  • This restores the conversation, not a stale human-handoff claim. If an advisor is still actively handling the chat, handoff state is preserved; expired claims are cleared so AI is not left paused.

Stored as persist_session and persist_session_hours in your service configuration.

See also Website integration — persist chat.


Optionally read a first-party cookie from your website and send its value to Airgentic as user_id. This links chat activity in Insights to an identifier you already use (for example a Marketo or analytics cookie). When Visitor profile CRM sync is enabled, the same value can be written to HubSpot (airgentic_user_id) or Marketo (airgenticUserId).

Setting Description
User ID cookie Exact cookie name on your site. Leave blank to skip.

Notes:

  • The cookie must be readable from JavaScript. HttpOnly cookies cannot be read.
  • user_id is only sent when this setting (or the embed attribute) is configured and the named cookie is present on the page.
  • Page-level data-user-id-cookie on the Airgentic script tag overrides this service setting when both are set.
  • user_id is a person identifier for Insights and CRM. It is separate from the chat session id (session_id). Do not use a CRM tracking cookie as the session key.

Stored as user_id_cookie in your service configuration.

See Website integration — User ID cookie and Visitor Profiles and CRM for embed syntax and CRM property setup.

← Back to Service Configuration overview

You have unsaved changes