> ## Documentation Index
> Fetch the complete documentation index at: https://docs.molin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Marketing tracking overview

> An overview of the tracking and analytics built into the Molin AI widget, including UTM tags, dataLayer events, and session integrations.

The Molin AI widget tracks how visitors use the AI assistant on your site. It starts on its own, so you don't need to set anything up.

## UTM tags

When a user clicks a link the AI provided in chat, the widget appends `utm_source=molin.ai` to the URL. You can then attribute that traffic to Molin AI in your analytics platform.

<Card title="UTM tags injection" icon="tag" href="/home/marketing/utm">
  Learn how UTM tags are injected into AI chat links.
</Card>

## Google Analytics & GTM (dataLayer)

The widget pushes events to `window.dataLayer` for Google Tag Manager integration. This includes the `molin_lead_collected` conversion event for ad campaign optimization, a general link click event, and standard GA4 e-commerce events (`view_item_list`, `select_item`, `view_item`) for product recommendations.

<Card title="Google Analytics & GTM" icon="chart-line" href="/home/marketing/integrations/google-analytics">
  See all dataLayer events including GA4 e-commerce tracking.
</Card>

## Klaviyo

If you use Klaviyo, the widget sends custom events to Klaviyo's client-side API automatically. You can trigger flows and build segments from chat interactions without configuring anything.

<Card title="Klaviyo" icon="envelope" href="/home/marketing/integrations/klaviyo">
  See which Klaviyo events are sent automatically.
</Card>

## Microsoft Clarity

If you use Microsoft Clarity, the widget tags sessions and fires custom events automatically. You can then filter your session recordings to see only those with Molin AI interactions.

<Card title="Microsoft Clarity" icon="eye" href="/home/marketing/integrations/microsoft-clarity">
  See which Clarity tags and events are sent automatically.
</Card>

## JavaScript lifecycle events

The widget dispatches `molin:ready`, `molin:chat-open`, and `molin:chat-close` events on `window`. Your site can listen for these to fire your own analytics or run any other custom logic.

<Card title="JavaScript lifecycle events" icon="code" href="/home/marketing/javascript-events">
  Listen for widget lifecycle events with standard JavaScript.
</Card>
