Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions code_samples/recommendations/events/category_parameter.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% block content %}
<div class="product-details">
<h1>{{ product.name }}</h1>
{# ... product content ... #}
</div>

{# Track with category identifier - automatic loading and formatting #}
{{ ibexa_tracking_track_event('visit', product, {
'categoryIdentifier': 'electronics'
}) }}
{% endblock %}
29 changes: 27 additions & 2 deletions docs/recommendations/raptor_integration/tracking_php_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## 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 from the server side.
The [`ServerSideTrackingDispatcherInterface::dispatch()`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-ConnectorRaptor-Tracking-ServerSideTrackingDispatcherInterface.html#method_dispatch) method allows sending 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 the available events in the [tracking event namespace](/api/php_api/php_api_reference/namespaces/ibexa-contracts-connectorraptor-tracking-event.html).
Expand Down Expand Up @@ -38,9 +38,34 @@
[[= include_file('code_samples/recommendations/EventMapper.php', 20, 27, remove_indent=True) =]]
```

### Category parameter for product events

In [[= product_name =]], products can be assigned to multiple categories.

Check notice on line 43 in docs/recommendations/raptor_integration/tracking_php_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/recommendations/raptor_integration/tracking_php_api.md#L43

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/recommendations/raptor_integration/tracking_php_api.md", "range": {"start": {"line": 43, "column": 39}}}, "severity": "INFO"}
However, Raptor accepts only a single category value in tracking events.

By default, the connector uses the first category from the list of categories assigned to the product.
You can override this behavior and define which category is sent in tracking events.

Check notice on line 47 in docs/recommendations/raptor_integration/tracking_php_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/recommendations/raptor_integration/tracking_php_api.md#L47

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/recommendations/raptor_integration/tracking_php_api.md", "range": {"start": {"line": 47, "column": 58}}}, "severity": "INFO"}

To do this:

1. Open the product page in the back office.
2. Check the categories assigned to the product and select the one you want to use.
3. Copy the identifier.
4. Pass this identifier as the category parameter in the tracking event.

!!! note

This option applies only to product-related tracking events.

Example:

``` twig+html
[[= include_file('code_samples/recommendations/events/category_parameter.html.twig') =]]
```

### Manual `EventData` creation

Manual creation of EventData allows precise control over the events sent to the service.
Manual creation of `EventData` allows precise control over the events sent to the service.
It enables you to define custom event parameters, track specific user interactions, and tailor data collection to advanced use cases.

Check the following example:
Expand Down
9 changes: 9 additions & 0 deletions docs/release_notes/ibexa_dxp_v5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,15 @@

For more information, see [recommendation blocks](https://doc.ibexa.co/en/5.0/recommendations/raptor_integration/recommendation_blocks/).

#### Category parameter for product events

You can now configure which product category is sent in tracking events.

Check notice on line 55 in docs/release_notes/ibexa_dxp_v5.0.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/release_notes/ibexa_dxp_v5.0.md#L55

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/release_notes/ibexa_dxp_v5.0.md", "range": {"start": {"line": 55, "column": 46}}}, "severity": "INFO"}

Raptor accepts only a single category value.
By default, the connector uses the first category assigned to a product, but you can override this behavior and select a different category to be included in tracking events.

Check warning on line 58 in docs/release_notes/ibexa_dxp_v5.0.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/release_notes/ibexa_dxp_v5.0.md#L58

[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.
Raw output
{"message": "[Ibexa.OxfordComma] Use a comma before the last 'and' or 'or' in a list of four or more items.", "location": {"path": "docs/release_notes/ibexa_dxp_v5.0.md", "range": {"start": {"line": 58, "column": 1}}}, "severity": "WARNING"}

Check notice on line 58 in docs/release_notes/ibexa_dxp_v5.0.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/release_notes/ibexa_dxp_v5.0.md#L58

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/release_notes/ibexa_dxp_v5.0.md", "range": {"start": {"line": 58, "column": 144}}}, "severity": "INFO"}

To learn more, see [category parameter for product events](https://doc.ibexa.co/en/5.0/recommendations/raptor_integration/tracking_php_api/#category-parameter-for-product-events).

#### Cookie lifetime configuration

A new `cookie_id_lifetime_days` configuration option controls the lifetime in days of the server-side tracking identifier cookie.
Expand Down
Loading