> ## 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.

# Klaviyo

> Understand how Molin AI integrates with Klaviyo for tracking customer interactions and triggering automations.

If you use [Klaviyo](https://www.klaviyo.com/) on your website, the Molin AI widget automatically sends custom events to Klaviyo. This lets you trigger flows, build segments, and analyze customer engagement based on chat interactions, with zero configuration.

## How it works

When a visitor interacts with the widget, we call the [Klaviyo client-side API](https://developers.klaviyo.com/en/docs/introduction_to_the_klaviyo_object) (`klaviyo.push(["track", ...])`) to fire custom events for key interactions. These events appear as metrics in your Klaviyo account and can be used in flows, segments, and reports.

<Note>If Klaviyo is not installed on your website, these calls are silently skipped. There is no performance impact and no errors.</Note>

## Custom events

Events are fired via `klaviyo.push(["track", name])` and appear as metrics in Klaviyo.

| Event                | When it fires                                   |
| -------------------- | ----------------------------------------------- |
| `molin_chat_open`    | User opens the chat window                      |
| `molin_chat_close`   | User closes the chat window                     |
| `molin_message_sent` | User sends a message in the chat                |
| `molin_link_click`   | User clicks a link inside the chat conversation |

## Using events in Klaviyo

Once events are flowing, you can:

* **Create flows** triggered by any of these events (e.g. send a follow-up email after a user interacts with the chat).
* **Build segments** based on event activity (e.g. "users who chatted in the last 7 days").
* **Analyze engagement** in Klaviyo's analytics dashboards.

<Note>
  Klaviyo's client-side tracking only records events for visitors who are already identified (cookied). Anonymous visitors who have not been identified via Klaviyo will not have events tracked.
</Note>

## Requirements

Klaviyo's onsite JavaScript (`klaviyo.js`) must already be installed on your website.
