Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,37 +1,29 @@
{{ ibexa_tracking_track_event(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'visit',
product,
{},
'@App/tracking/custom_visit.html.twig'
) }}
```

{# templates/tracking/custom_visit.html.twig #}

{#
# Custom visit tracking template
#
# Available variables:
# - parameters: array of Raptor tracking parameters (p1, p2, p3, etc.)
# - debug: boolean flag to enable debug console messages
#}
{#
# Custom visit tracking template
#
# Available variables:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Available variables:
# Available variables (passed to the template by `ibexa_tracking_track_event`):

# - parameters: array of Raptor tracking parameters (p1, p2, p3, etc.)
# - debug: boolean flag to enable debug console messages
#}

<script type="text/javascript">
{% autoescape 'js' %}
(function () {
// Custom logic before tracking
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
<script type="text/javascript">
{% autoescape 'js' %}
(function () {
// Custom logic before tracking
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
Comment on lines +14 to +16
Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, parameters variable could look like this?:

Suggested change
// Custom logic before tracking
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
// Custom logic before tracking
{% set parameters = {'p1': 'visit', 'p2': product.code} %}
{% if debug %}
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
{% endif %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "Custom templates" section needs a reminder of https://content.raptorservices.com/help-center/tracking-events-for-recommendation ressource

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the parameters variable should not be set in the template like that.
The parameters variable is already constructed by the backend before being passed to the template.

When you call ibexa_tracking_track_event('visit', product, ...):

  1. The backend's EventMapper processes the product object
  2. Creates the full parameters array with all required fields (p1, p2, p3, p4, p6, p12, p18, etc.)
  3. Passes this ready-to-use array to the template

The template receives parameters already populated like:
[
'p1' => 'visit',
'p2' => 'PRODUCT-CODE-123',
'p3' => 'Product Name',
'p4' => '1#Electronics;2#Laptops',
'p6' => 'USD',
'p12' => '999.99',
'p18' => 'BASE-PRODUCT-CODE'
]

Important: The product object is NOT available in the template - only parameters and debug are passed.

If you need to customize parameters, you can modify them (not replace):
{% set parameters = parameters|merge({'p7': 'custom-website-id'}) %}
But don't overwrite the entire array - you'd lose all the backend-prepared data.

Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get it! So we could remind that this is a received value. Even show that it could be edited:

Suggested change
// Custom logic before tracking
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
// Custom logic before tracking
{# For example, always override the website ID by editing the received parameters: #}
{% set parameters = parameters|merge({'p7': 'custom-website-id'}) %}
{% if debug %}
console.log('Custom visit tracking template');
console.log('Tracking parameters:', {{ parameters|json_encode|raw }});
{% endif %}


// Send the tracking event (REQUIRED for tracking to work)
const event = 'trackEvent';
const params = {{ parameters|json_encode|raw }};
window.raptor.push(event, params);
// Send the tracking event (REQUIRED for tracking to work)
const event = 'trackEvent';
Copy link
Copy Markdown
Contributor

@adriendupuis adriendupuis Apr 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this must not be confused with p1. What are the possible values?
Seing https://github.com/ibexa/connector-raptor/blob/main/src/bundle/Resources/views/themes/standard/ibexa/tracking/script.html.twig I wonder if this can be changed.

Suggested change
const event = 'trackEvent';
const event = 'trackEvent'; // Don't change this value.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed confusing and needs clarification.
The event parameter is NOT the same as p1:

  • event = Raptor JavaScript API method name (e.g., 'trackEvent')
  • p1 = Event type parameter (e.g., 'visit', 'buy', 'basket', 'pageview')

For event tracking, the value should always be 'trackEvent' (Raptor API method). This shouldn't be changed unless you're calling a different Raptor API method.

Your suggestion is good:
const event = 'trackEvent'; // Don't change this - Raptor API method name

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const event = 'trackEvent';
const event = 'trackEvent'; // Don't change this - Raptor API method name

const params = {{ parameters|json_encode|raw }};
window.raptor.push(event, params);

// Custom logic after tracking
{% if debug %}
console.log('Visit event tracked successfully');
{% endif %}
})();
{% endautoescape %}
</script>
// Custom logic after tracking
{% if debug %}
console.log('Visit event tracked successfully');
{% endif %}
})();
{% endautoescape %}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ month_change: false
The integrated help menu is part of the Integrated help introduced as an [LTS Update](editions.md#lts-updates).
By default, it provides editors and developers with convenient access to documentation, training and other resources directly from the back office.

You can extend or modify the integrated menu in two ways:
You can extend or modify the integrated menu in the following ways:

- by disabling it for all users
- by modifying a link to user documentation
Expand Down
40 changes: 20 additions & 20 deletions docs/ai_actions/configure_ai_actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,26 @@ You can also change the default values globally.
To do it, in `config/packages` folder, create a YAML file similar to this example:

```yaml
ibexa_connector_gemini:
text_to_text:
models:
gemini-pro-latest:
label: 'Gemini Pro Latest'
max_tokens: 4096
gemini-flash-latest:
label: 'Gemini Flash Latest'
max_tokens: 4096
default_model: gemini-pro-latest
default_max_tokens: 4096 # Must be <= the model’s max_tokens
default_temperature: 0.8
image_to_text:
models:
gemini-flash-latest:
label: 'Gemini Flash Latest'
max_tokens: 4096
default_model: gemini-flash-latest
default_max_tokens: 4096
default_temperature: 1.0
ibexa_connector_gemini:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed indent to make it easier to copy-paste this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be moved to a .yaml file

text_to_text:
models:
gemini-pro-latest:
label: 'Gemini Pro Latest'
max_tokens: 4096
gemini-flash-latest:
label: 'Gemini Flash Latest'
max_tokens: 4096
default_model: gemini-pro-latest
default_max_tokens: 4096 # Must be <= the model’s max_tokens
default_temperature: 0.8
image_to_text:
models:
gemini-flash-latest:
label: 'Gemini Flash Latest'
max_tokens: 4096
default_model: gemini-flash-latest
default_max_tokens: 4096
default_temperature: 1.0
```

When setting up models, make sure that you follow these rules:
Expand Down
2 changes: 1 addition & 1 deletion docs/product_catalog/quable/configure_quable_connector.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ibexa_connector_quable:
|-----------|--------------------------|-------------|
| `enabled` | `false` | Enables the connector. |
| `instance_url` | string | Base URL of your [[= pim_product_name =]] instance, for example `https://example.quable.com`. |
| `api_token` | string | [Read Access API token](https://docs.quable.com/v5-EN/docs/system-api-tokens) used to authenticate requests to [[= pim_product_name =]]. |
| `api_token` | string | [Read Access API token](https://docs.quable.com/v5-EN/docs/api-tokens) used to authenticate requests to [[= pim_product_name =]]. |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quable changed their doc and link broke

| `channel_code` | string | Code of the [[[= pim_product_name =]] channel](https://docs.quable.com/v5-EN/docs/content-channels) used as the source of product data. |
| `webhook_secret` | string | Secret expected in the [webhook](https://docs.quable.com/v5-EN/docs/webhook) authorization header. |
| `language_map` | Empty | Maps [[= product_name =]] language codes (for example, `eng-GB`) to [[= pim_product_name =]] locale codes (for example, `en_GB`). For more information, see [Set up [[= pim_product_name =]] languages](/product_catalog/quable/install_quable.md) |
Expand Down
2 changes: 1 addition & 1 deletion docs/product_catalog/quable/quable_api.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: Quable API
description: Learn how to use PHP and REST APIs to retrieve product data from Quable

Check failure on line 2 in docs/product_catalog/quable/quable_api.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/product_catalog/quable/quable_api.md#L2

[Ibexa.VariablesGlobal] Use global variable '[[= pim_product_name =]]' instead of 'Quable'
Raw output
{"message": "[Ibexa.VariablesGlobal] Use global variable '[[= pim_product_name =]]' instead of 'Quable'", "location": {"path": "docs/product_catalog/quable/quable_api.md", "range": {"start": {"line": 2, "column": 79}}}, "severity": "ERROR"}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

month_change: true
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Raptor integration introduces two Twig functions:
## Embed tracking script

You must embed the tracking script into the website’s layout to enable tracking.
To do it, add the `ibexa_tracking_script()` twig function into the <head> section of your base layout template, for example, `@ibexadesign/pagelayout.html.twig`:
To do it, add the `ibexa_tracking_script()` Twig function into the <head> section of your base layout template, for example, `@ibexadesign/pagelayout.html.twig`:

``` html+twig
[[= include_file('code_samples/recommendations/templates/themes/standard/pagelayout.html.twig') =]]
Expand Down
2 changes: 1 addition & 1 deletion docs/search/criteria_reference/taxonomy_no_entries.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ It's available for all supported search engines and in [repository filtering](se

The following example searches for articles that have no entries assigned in the `tags` taxonomy:

```php hl_lines="11-14"
```php hl_lines="11-16"
[[= include_file('code_samples/search/content/taxonomy_no_entries_criterion.php') =]]
```

Expand Down
2 changes: 1 addition & 1 deletion docs/search/criteria_reference/taxonomy_subtree.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The [`TaxonomySubtree`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-T

The following example searches for articles assigned to taxonomy entry with ID `42` or any of its child entries:

```php hl_lines="11-14"
```php hl_lines="11-16"
[[= include_file('code_samples/search/content/taxonomy_subtree_criterion.php') =]]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
The `ibexa_tracking_script()` Twig function allows you to embed the main tracking script into the website.
It loads the initial script into `window.raptor`.
The script then enables event tracking, such as page visits, product views, or buys, from the front end.
It can be overridden in multiple ways to support custom implementations and to render code snippet through [[= product_name_base =]] in the [design engine](design_engine.md).
It can be overridden in multiple ways to support custom implementations and to render code snippet through [[= product_name =]] in the [design engine](design_engine.md).

Check notice on line 15 in docs/templating/twig_function_reference/recommendations_twig_functions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/templating/twig_function_reference/recommendations_twig_functions.md#L15

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/templating/twig_function_reference/recommendations_twig_functions.md", "range": {"start": {"line": 15, "column": 8}}}, "severity": "INFO"}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

product_name_base - Ibexa
product_name - Ibexa DXP


Tracking can be conditionally initialized depending on cookie consent logic.
By default, for client-side use, the function returns a script, but it can return nothing when used server-side.
Expand Down Expand Up @@ -58,7 +58,7 @@

The `ibexa_tracking_track_event()` function is responsible for sending event data to the service, which enables tracking of user interactions and behaviors.

Tracking is handled through a twig function that accept following parameters:
Tracking is handled through a Twig function that accept following parameters:

Check notice on line 61 in docs/templating/twig_function_reference/recommendations_twig_functions.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/templating/twig_function_reference/recommendations_twig_functions.md#L61

[Ibexa.Passive] Try to avoid passive tense, when possible.
Raw output
{"message": "[Ibexa.Passive] Try to avoid passive tense, when possible.", "location": {"path": "docs/templating/twig_function_reference/recommendations_twig_functions.md", "range": {"start": {"line": 61, "column": 10}}}, "severity": "INFO"}

``` html+twig
ibexa_tracking_track_event(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ In addition to the [native functions provided by Twig](https://twig.symfony.com/
"templating/twig_function_reference/field_twig_functions",
"templating/twig_function_reference/page_twig_functions",
"templating/twig_function_reference/product_twig_functions",
"templating/twig_function_reference/recommendations_twig_functions",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was missing

"templating/twig_function_reference/site_context_twig_functions",
"templating/twig_function_reference/storefront_twig_functions",
"templating/twig_function_reference/icon_twig_functions",
Expand Down
Loading