---
title: "How to send analytics events through Flowbox's API"
url: "https://kb.getflowbox.com/en/article/how-to-send-analytics-events-through-flowboxs-api"
language: "en"
last_updated: "2026-06-19T07:27:31.150Z"
---

# How to send analytics events through Flowbox's API

Learn how to trigger analytics events by Flowbox API so you can track your integration's performance in Flowbox.

## API endpoint

To send analytics data to Flowbox, a 'POST' request needs to be executed through this endpoint:

[`https://external-api.getflowbox.com/v2/analytics/event-tracking`](https://external-api.getflowbox.com/v2/analytics/event-tracking)

> You can find more information and execute test requests in our [Swaggerhub page](https://app.swaggerhub.com/apis-docs/FlowboxAB/External-API/v2#/External%20API/EventTracking).

## Purpose

In order to have Analytics data [available in Flowbox](https://kb.getflowbox.com/en/article/website-analytics-overview) for your external API integration, you will need to handle the analytics events that the regular embed HTML Flows would trigger by firing them upon user visualization or interaction.

Each analytics event is meant for a specific purpose and as such they have different names.

Any event that is tracked needs to be assigned to a user-specific UUID, which is used as a value for the `user_id` field. This UUID needs to remain the same value during the a unique user's session in order to track each of the user's interactions separately. In embed HTML Flows, this is handled by generating a ["\_flowbox" cookie](https://kb.getflowbox.com/en/article/embed-flows-cookies).

## Required parameters

-   **api-key** (header - string): This is your API authentication key, it must be included in the request header.

-   **Request body** (application/JSON): can be different depending on the event that is being reported. Here's an example of its formatting:

```
{  
  "user_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",  
  "from_url": "string",  
  "data": {  
    "event_name": "post_clicked",  
    "flow_key": "string",  
    "post_id": [  
      "string"  
    ]  
  }  
}
```

All events require the following fields within the request body. These are detailed under "[BaseEvent](https://app.swaggerhub.com/apis-docs/FlowboxAB/External-API/v2#/BaseEvent)" Schema:

-   **user\_id:** User identifier. Needs to follow a UUID format, and is meant to identify the actions of each unique user. It needs to remain the same during each user's session.

-   **from\_url:** URL from which the event was triggered from.

-   **data:** Event-specific data. Might require additional parameters depending on the event, but at the very least always requires the following ones:

-   -   **event\_name:** the name of the event ("embed\_viewed", "post\_clicked", "post\_viewed"...)
    -   **flow\_key:** the Flow key for which this event is being triggered.

## List of events

> It's not mandatory to integrate all the events listed below, although it's recommended to implement at least "**embed\_viewed**", "**post\_clicked**", "**post\_viewed**", "**cta\_clicked**" and "**checkout\_conversion**" in order to allow for most of the metrics to be calculated.

| **EVENT NAME** | **DESCRIPTION** | **REQUIRED DATA FIELDS** |
| --- | --- | --- |
| **embed\_viewed** | When the image gallery is loaded and visible on a page. | -   `visible_post_ids` (Array comprised of strings): IDs for the posts that are in the viewport of a user |
| **embed\_load\_more\_clicked** | When the 'Load more' button in the gallery is clicked. In case of unlimited scroll, can be triggered each time an additional page of content is loaded. | None |
| **embed\_carousel\_next\_post\_clicked** | For posts displayed on a "carousel" view, when a button is clicked on either side that allows the user to view more posts | None |
| **post\_clicked** | When a post within the post gallery is clicked. | -   `post_id` (String): Post key for the post that has been clicked. |
| **post\_viewed** | When a clicked post is displayed, allowing the user to view it within a gate or lightbox. | -   `post_id` (String): Post key for the post that has been viewed.<br>-   `visible_product_keys` (Array comprised of strings): Keys of the products that are displayed next to the viewed post. |
| **gate\_next\_post\_clicked** | When navigation buttons are clicked within the gate to navigate between posts. | None |
| **post\_carousel\_next\_media\_clicked** | When navigation buttons are clicked in a post with more than one photo or video ("carousel" posts). | -   `post_id` (String): Post key for the post whose images are being navigated. |
| **cta\_clicked** | When a custom CTA button assigned to a post has been clicked | -   `post_id` (String): Post key for the post that is associated with this custom CTA button.<br>-   `cta_type` (String): valid values are `product_cta`, `standalone_cta` or `flow_cta`.<br>-   `product_key` (String): Product key for the product associated with the CTA click |
| **checkout\_conversion** | When a customer finishes a purchase. It's meant to be executed right after every successful order. Allows to track [Assisted Sales](https://kb.getflowbox.com/en/article/website-analytics-conversion). For further reference on the structure, check "[EventCheckoutConversion](https://app.swaggerhub.com/apis-docs/FlowboxAB/External-API/v2#/EventCheckoutConversion)" Schema. | **Mandatory fields:**<br>-   `conversion_type` (String): valid values are `purchase`, `booking`, `other`.<br>-   `items` (Array comprised of Objects): List of purchased items. Requires `product_id`, `quantity`, `price` and `currency` for each item.<br>-   `order_id` (String): Unique identifier of the order associated with this checkout event.<br>-   `flow_key` (String): Unique identifier of the Flow key the client interacted with.<br>**Following fields are only relevant for Ratings & Reviews users:**<br>-   `locale` (String): Locale for the language associated with this event. Used to set up the language for the Rating's email.<br>-   `customer_data` (Array): customer's name & contact information. Used to reach out the customer with a review request. Can handle the following fields: `name`, `lastname`, `email` and `mobile`. |
