Conversation
| @@ -1,37 +1,29 @@ | |||
| {{ ibexa_tracking_track_event( | |||
There was a problem hiding this comment.
| default_model: gemini-flash-latest | ||
| default_max_tokens: 4096 | ||
| default_temperature: 1.0 | ||
| ibexa_connector_gemini: |
There was a problem hiding this comment.
Removed indent to make it easier to copy-paste this
There was a problem hiding this comment.
could be moved to a .yaml file
| | `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 =]]. | |
There was a problem hiding this comment.
Quable changed their doc and link broke
| @@ -1,5 +1,5 @@ | |||
| --- | |||
| description: Quable API | |||
| description: Learn how to use PHP and REST APIs to retrieve product data from Quable | |||
There was a problem hiding this comment.
Preview looked wrong in the cards:
https://ez-systems-developer-documentation--3134.com.readthedocs.build/en/3134/product_catalog/quable/quable/#development
| 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). |
There was a problem hiding this comment.
product_name_base - Ibexa
product_name - Ibexa DXP
| "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", |
code_samples/ change report
|
|
adriendupuis
left a comment
There was a problem hiding this comment.
oportunity to re-read the examples
| default_model: gemini-flash-latest | ||
| default_max_tokens: 4096 | ||
| default_temperature: 1.0 | ||
| ibexa_connector_gemini: |
There was a problem hiding this comment.
could be moved to a .yaml file
| // Custom logic before tracking | ||
| console.log('Custom visit tracking template'); | ||
| console.log('Tracking parameters:', {{ parameters|json_encode|raw }}); |
There was a problem hiding this comment.
If I understand correctly, parameters variable could look like this?:
| // 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 %} |
There was a problem hiding this comment.
The "Custom templates" section needs a reminder of https://content.raptorservices.com/help-center/tracking-events-for-recommendation ressource
There was a problem hiding this comment.
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, ...):
- The backend's EventMapper processes the product object
- Creates the full parameters array with all required fields (p1, p2, p3, p4, p6, p12, p18, etc.)
- 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.
There was a problem hiding this comment.
Get it! So we could remind that this is a received value. Even show that it could be edited:
| // Custom logic before tracking | |
| console.log('Custom visit tracking template'); | |
| console.log('Tracking parameters:', {{ parameters|json_encode|raw }}); | |
| // Custom logic before tracking | |
| {# For example, alway 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 %} |
| const params = {{ parameters|json_encode|raw }}; | ||
| window.raptor.push(event, params); | ||
| // Send the tracking event (REQUIRED for tracking to work) | ||
| const event = 'trackEvent'; |
There was a problem hiding this comment.
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.
| const event = 'trackEvent'; | |
| const event = 'trackEvent'; // Don't change this value. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
| const event = 'trackEvent'; | |
| const event = 'trackEvent'; // Don't change this - Raptor API method name |
| {# | ||
| # Custom visit tracking template | ||
| # | ||
| # Available variables: |
There was a problem hiding this comment.
| # Available variables: | |
| # Available variables (passed to the template by `ibexa_tracking_track_event`): |
| // Custom logic before tracking | ||
| console.log('Custom visit tracking template'); | ||
| console.log('Tracking parameters:', {{ parameters|json_encode|raw }}); |
There was a problem hiding this comment.
Get it! So we could remind that this is a received value. Even show that it could be edited:
| // Custom logic before tracking | |
| console.log('Custom visit tracking template'); | |
| console.log('Tracking parameters:', {{ parameters|json_encode|raw }}); | |
| // Custom logic before tracking | |
| {# For example, alway 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 %} |



Small fixes to issues found when reviewing the code
Contains fixes from #3139