> For the complete documentation index, see [llms.txt](https://docs.yoplanning.support/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yoplanning.support/en/yoplanning-academy/yoplanning-parametrage/module-de-reservation/integration-du-module-de-reservation/doc-technique-agence-web/evenements-e-commerce-envoyes-vers-google-analytics.md).

# E-commerce events sent to Google Analytics

Once Google Tag Manager is integrated into your booking module, YoPlanning automatically triggers the following e-commerce events if you activate them in your back office.

***

### 📦 `view_item`

Triggered when clicking on a product detail.

**Data sent**:

* `item_name` (product name)

***

### 🛒 `add_to_cart`

Triggered when adding a session or gift voucher (GBV) to the cart.

**Data sent**:

```json
{
  "currency": "EUR",
  "value": 150,
  "items": [
    {
      "item_name": "Canoë 3h",
      "item_variant": "session",
      "quantity": 2
    }
  ]
}
```

***

### 💳 `begin_checkout`

Triggered when clicking "Pay" on the last page.

**Data sent**:

```json
{
  "currency": "EUR",
  "value": 180,
  "cart_id": "YO123456"
}
```

***

### ✅ `purchase`

Triggered at the end of payment. Two modes exist depending on the type of booking module integration.

***

#### 🔗 **Direct Access** Mode

* The event is automatically triggered at the end of the payment.
* No additional configuration is required.

***

#### 🧩 **iframe** mode

If the module is integrated via an iframe on your site:

* You must define a **success URL** in your module configuration in YoPlanning.
* This URL must be:
  * on the **same domain** as your site (eg: `example.com/merci`)
  * and **include the YoPlanning integration script** (even if no module is displayed on this page)

Thanks to this redirection, the `purchase` event is successfully sent in the background.

***

#### 🧾 Data sent with the `purchase` event

```json
{
  "currency": "EUR",
  "value": 240,
  "transaction_id": "YO654321",
  "transaction_source": "Online",
  "items": [
    {
      "item_name": "Randonnée guidée",
      "item_variant": "session",
      "price": 120,
      "quantity": 2
    }
  ]
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.yoplanning.support/en/yoplanning-academy/yoplanning-parametrage/module-de-reservation/integration-du-module-de-reservation/doc-technique-agence-web/evenements-e-commerce-envoyes-vers-google-analytics.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
