+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/recommendations/raptor_integration/tracking_php_api.md b/docs/recommendations/raptor_integration/tracking_php_api.md
index 2f93cfac48..8bcd3a1681 100644
--- a/docs/recommendations/raptor_integration/tracking_php_api.md
+++ b/docs/recommendations/raptor_integration/tracking_php_api.md
@@ -9,15 +9,33 @@ You can interact directly with the [Raptor connector](raptor_connector.md)'s ser
## Advanced usage – direct interaction with the service
+The [`ServerSideTrackingDispatcherInterface::dispatch()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-ServerSideTrackingDispatcherInterface.html#method_dispatch) method allows to send tracking data fom the server side.
+It can be used in controllers, event subscribers, or any other part of the application.
+This method receives an [`EventDataInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html).
+For more information, see available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
+
### Mapping event data
-The recommended method, providing full control over event tracking, is [`EventMapperInterface::map()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventMapperInterface.html#method_map) method.
-It allows you to interact directly with the service, supporting advanced use cases not covered by default implementation.
+The recommended method is [`EventMapperInterface::map()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventMapperInterface.html#method_map) method.
+This method receives an [`EventType`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventType.html#cases) case, a data depending on the event type,
+and a context's associative array using [`EventContext`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventContext.html) constants as keys.
+
+For more information, see the same arguments of the Twig function [`ibexa_tracking_track_event`](recommendations_twig_functions.md#ibexa_tracking_track_event-function).
+
+| Event type | Data class | Context keys |
+|:---------------------------|:------------------------|:-------------------------------------------------------------------------------------------------------------------------|
+| `EventType::VISIT` | `ProductInterface` | (optional) `EventContext::WEBSITE_ID` |
+| `EventType::CONTENT_VISIT` | `Content` | (optional) `EventContext::WEBSITE_ID` |
+| `EventType::BUY` | `ProductInterface` | `EventContext::SUBTOTAL`, `EventContext::CURRENCY`, `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
+| `EventType::BASKET` | `ProductInterface` | `EventContext::BASKET_CONTENT`, `EventContext::BASKET_ID`, (optional) `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
+| `EventType::ITEM_CLICK` | `string` (product code) | `EventContext::MODULE_NAME`, `EventContext::REDIRECT_URL` |
Check the following example:
``` php
-[[= include_file('code_samples/recommendations/EventMapper.php') =]]
+[[= include_file('code_samples/recommendations/EventMapper.php', 4, 8) =]]//…
+
+[[= include_file('code_samples/recommendations/EventMapper.php', 20, 29, remove_indent=True) =]]
```
### Manual `EventData` creation
@@ -30,7 +48,7 @@ Check the following example:
``` php
[[= include_file('code_samples/recommendations/EventData.php', 4, 6) =]]// …
-[[= include_file('code_samples/recommendations/EventData.php', 16, 25, remove_indent=True) =]]
+[[= include_file('code_samples/recommendations/EventData.php', 17, 26, remove_indent=True) =]]
```
`categoryPath` parameter sets the category path for recommendations and needs to be composed manually following the specified format and rules:
@@ -39,16 +57,16 @@ Check the following example:
- if `CategoryName` is missing, repeat the ID, for example, `25#25;26#26`
- if `CategoryId` is missing, use the `CategoryName`, for example, `Electronics;Smartphones`
-For more information, see available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html)
+For more information, see available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
### Example - event subscriber
-If you need to track [events](../../api/event_reference/event_reference.md) automatically based on application events, you can use Event Subscriber.
+If you need to track [events](event_reference.md) automatically based on application events, you can use Event Subscriber.
It reacts to specific events in the application and triggers tracking logic without the need to add it manually in templates.
``` php
[[= include_file('code_samples/recommendations/EventSubscriber.php') =]]
```
-You can also use [[= product_name =]] events, for example `CreateOrderEvent` from [Order management events](../../api/event_reference/order_management_events.md).
+You can also use [[= product_name =]] events, for example `CreateOrderEvent` from [Order management events](order_management_events.md).
For more information, see [Event reference](event_reference.md).
From 04b3d39963b9b2b6182261148e8ae7897d795f3e Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Mon, 13 Apr 2026 12:34:25 +0200
Subject: [PATCH 07/10] Missing PHP API pages
---
...tor-Tracking-Event-EventDataInterface.html | 441 +++++++++++++++
...ts-ConnectorRaptor-Tracking-EventType.html | 508 ++++++++++++++++++
2 files changed, 949 insertions(+)
create mode 100644 docs/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html
create mode 100644 docs/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventType.html
diff --git a/docs/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html b/docs/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html
new file mode 100644
index 0000000000..4557eb6f90
--- /dev/null
+++ b/docs/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html
@@ -0,0 +1,441 @@
+
+
+
+
+ EventDataInterface | PHP API Reference (Ibexa Documentation)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
From 0f18cfd2f74a7a361d2c15cad31f1c88db5687ee Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Mon, 13 Apr 2026 13:09:26 +0200
Subject: [PATCH 08/10] Apply suggestions from code review
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
---
.../raptor_integration/tracking_php_api.md | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/docs/recommendations/raptor_integration/tracking_php_api.md b/docs/recommendations/raptor_integration/tracking_php_api.md
index 8bcd3a1681..9054950d1f 100644
--- a/docs/recommendations/raptor_integration/tracking_php_api.md
+++ b/docs/recommendations/raptor_integration/tracking_php_api.md
@@ -9,16 +9,15 @@ You can interact directly with the [Raptor connector](raptor_connector.md)'s ser
## Advanced usage – direct interaction with the service
-The [`ServerSideTrackingDispatcherInterface::dispatch()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-ServerSideTrackingDispatcherInterface.html#method_dispatch) method allows to send tracking data fom the server side.
+The [`ServerSideTrackingDispatcherInterface::dispatch()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-ServerSideTrackingDispatcherInterface.html#method_dispatch) method allows to send tracking data from the server side.
It can be used in controllers, event subscribers, or any other part of the application.
This method receives an [`EventDataInterface`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-Event-EventDataInterface.html).
-For more information, see available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
+For more information, see the available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
### Mapping event data
-The recommended method is [`EventMapperInterface::map()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventMapperInterface.html#method_map) method.
-This method receives an [`EventType`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventType.html#cases) case, a data depending on the event type,
-and a context's associative array using [`EventContext`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventContext.html) constants as keys.
+The recommended method is [`EventMapperInterface::map()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventMapperInterface.html#method_map).
+This method receives an [`EventType`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventType.html#cases) case, a data depending on the event type, and a context's associative array that uses [`EventContext`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-EventContext.html) constants as keys.
For more information, see the same arguments of the Twig function [`ibexa_tracking_track_event`](recommendations_twig_functions.md#ibexa_tracking_track_event-function).
@@ -57,11 +56,11 @@ Check the following example:
- if `CategoryName` is missing, repeat the ID, for example, `25#25;26#26`
- if `CategoryId` is missing, use the `CategoryName`, for example, `Electronics;Smartphones`
-For more information, see available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
+For more information, see the available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
### Example - event subscriber
-If you need to track [events](event_reference.md) automatically based on application events, you can use Event Subscriber.
+If you need to track [events](event_reference.md) automatically based on application events, you can use an event subscriber.
It reacts to specific events in the application and triggers tracking logic without the need to add it manually in templates.
``` php
From b4b744a7d92bf15c0b60d46290bab9873f182bc5 Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Mon, 13 Apr 2026 15:00:09 +0200
Subject: [PATCH 09/10] tracking_php_api.md: EventContext::CATEGORY_IDENTIFIER
---
code_samples/recommendations/EventMapper.php | 8 +++-----
.../raptor_integration/tracking_php_api.md | 16 ++++++++--------
2 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/code_samples/recommendations/EventMapper.php b/code_samples/recommendations/EventMapper.php
index e48d166850..cf0bd3bd8e 100644
--- a/code_samples/recommendations/EventMapper.php
+++ b/code_samples/recommendations/EventMapper.php
@@ -18,11 +18,9 @@ public function __construct(
public function trackProductView(ProductInterface $product): void
{
- // Map product to BuyEventData automatically
- $eventData = $this->eventMapper->map(EventType::BUY, $product, [
- EventContext::SUBTOTAL => '200',
- EventContext::CURRENCY => 'EUR',
- EventContext::QUANTITY => '2',
+ // Map product to VisitEventData automatically, override its category
+ $eventData = $this->eventMapper->map(EventType::VISIT, $product, [
+ EventContext::CATEGORY_IDENTIFIER => 'electronics',
]);
// Send tracking event
diff --git a/docs/recommendations/raptor_integration/tracking_php_api.md b/docs/recommendations/raptor_integration/tracking_php_api.md
index 9054950d1f..13e5e6884f 100644
--- a/docs/recommendations/raptor_integration/tracking_php_api.md
+++ b/docs/recommendations/raptor_integration/tracking_php_api.md
@@ -21,20 +21,20 @@ This method receives an [`EventType`](/api/php_api/php_api_reference/classes/Ibe
For more information, see the same arguments of the Twig function [`ibexa_tracking_track_event`](recommendations_twig_functions.md#ibexa_tracking_track_event-function).
-| Event type | Data class | Context keys |
-|:---------------------------|:------------------------|:-------------------------------------------------------------------------------------------------------------------------|
-| `EventType::VISIT` | `ProductInterface` | (optional) `EventContext::WEBSITE_ID` |
-| `EventType::CONTENT_VISIT` | `Content` | (optional) `EventContext::WEBSITE_ID` |
-| `EventType::BUY` | `ProductInterface` | `EventContext::SUBTOTAL`, `EventContext::CURRENCY`, `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
-| `EventType::BASKET` | `ProductInterface` | `EventContext::BASKET_CONTENT`, `EventContext::BASKET_ID`, (optional) `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
-| `EventType::ITEM_CLICK` | `string` (product code) | `EventContext::MODULE_NAME`, `EventContext::REDIRECT_URL` |
+| Event type | Data class | Context keys |
+|:---------------------------|:------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------|
+| `EventType::VISIT` | `ProductInterface` | (optional) `EventContext::CATEGORY_IDENTIFIER`, (optional) `EventContext::WEBSITE_ID` |
+| `EventType::CONTENT_VISIT` | `Content` | (optional) `EventContext::WEBSITE_ID` |
+| `EventType::BUY` | `ProductInterface` | `EventContext::SUBTOTAL`, `EventContext::CURRENCY`, `EventContext::QUANTITY`, (optional) `EventContext::CATEGORY_IDENTIFIER`, (optional) `EventContext::WEBSITE_ID` |
+| `EventType::BASKET` | `ProductInterface` | `EventContext::BASKET_CONTENT`, `EventContext::BASKET_ID`, (optional) `EventContext::CATEGORY_IDENTIFIER`, (optional) `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
+| `EventType::ITEM_CLICK` | `string` (product code) | `EventContext::MODULE_NAME`, `EventContext::REDIRECT_URL` |
Check the following example:
``` php
[[= include_file('code_samples/recommendations/EventMapper.php', 4, 8) =]]//…
-[[= include_file('code_samples/recommendations/EventMapper.php', 20, 29, remove_indent=True) =]]
+[[= include_file('code_samples/recommendations/EventMapper.php', 20, 27, remove_indent=True) =]]
```
### Manual `EventData` creation
From 70cc0a93f02b836f42d1df73eef0fc7d158bfa76 Mon Sep 17 00:00:00 2001
From: Adrien Dupuis <61695653+adriendupuis@users.noreply.github.com>
Date: Mon, 13 Apr 2026 15:46:25 +0200
Subject: [PATCH 10/10] tracking_php_api.md: caution about buy event
---
.../raptor_integration/tracking_php_api.md | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/recommendations/raptor_integration/tracking_php_api.md b/docs/recommendations/raptor_integration/tracking_php_api.md
index 13e5e6884f..e90093a6cd 100644
--- a/docs/recommendations/raptor_integration/tracking_php_api.md
+++ b/docs/recommendations/raptor_integration/tracking_php_api.md
@@ -29,6 +29,11 @@ For more information, see the same arguments of the Twig function [`ibexa_tracki
| `EventType::BASKET` | `ProductInterface` | `EventContext::BASKET_CONTENT`, `EventContext::BASKET_ID`, (optional) `EventContext::CATEGORY_IDENTIFIER`, (optional) `EventContext::QUANTITY`, (optional) `EventContext::WEBSITE_ID` |
| `EventType::ITEM_CLICK` | `string` (product code) | `EventContext::MODULE_NAME`, `EventContext::REDIRECT_URL` |
+!!! caution
+
+ The `EventType::BUY` type and the `BuyEventData` class aren't production-ready yet, they're missing the [`BrandId` parameter (P8)](https://content.raptorservices.com/help-center/tracking-events-for-recommendation), and their usage may change in the future.
+
+
Check the following example:
``` php
@@ -58,6 +63,10 @@ Check the following example:
For more information, see the available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
+!!! caution
+
+ The `BuyEventData` class isn't production-ready yet, it's missing the [`BrandId` parameter (P8)](https://content.raptorservices.com/help-center/tracking-events-for-recommendation), and its usage may change in the future.
+
### Example - event subscriber
If you need to track [events](event_reference.md) automatically based on application events, you can use an event subscriber.