Skip to content

Commit 586afee

Browse files
authored
IBX-8970 Improved personalization details. (#2515)
1 parent 7da580c commit 586afee

File tree

4 files changed

+28
-23
lines changed

4 files changed

+28
-23
lines changed

docs/personalization/enable_personalization.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ instance must [request access to the service]([[= user_doc =]]/personalization/e
1414
## Set up customer credentials
1515

1616
When you receive the credentials, add them to your configuration.
17-
In the root folder of your project, edit either the `.env` or `.env.local` file
17+
In the root folder of your project, edit the `.env.local` file
1818
by adding the following lines with your customer ID and license key:
1919

2020
```
@@ -23,7 +23,7 @@ PERSONALIZATION_LICENSE_KEY=67890-1234-5678-90123-4567
2323
PERSONALIZATION_HOST_URI=https://server_uri
2424
```
2525

26-
!!! note "Configuring user credentials for different customers"
26+
!!! note "Configuring user credentials for multisite setup and different personalization customers"
2727

2828
If your installation [hosts multiple sites]([[= user_doc =]]/personalization/use_cases/#multiple-website-hosting) with different
2929
customer IDs, for example, to provide separate recommendations for different
@@ -140,6 +140,9 @@ ibexa:
140140
content:
141141
use_remote_id: true
142142
```
143+
!!! note "Support for alphanumeric content identifier"
144+
145+
Contact [email protected] with your organization's requirements to have the alphanumeric content identifier enabled.
143146

144147
#### Enable tracking
145148

@@ -437,8 +440,8 @@ if the content Fields were previously exported by the export script.
437440
"itemType": 38,
438441
"relevance": 3,
439442
"links": {
440-
"clickRecommended": "//event.test.perso.ibexa.co/api/723/clickrecommended/someuser/38/71?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736",
441-
"rendered": "//event.test.perso.ibexa.co/api/723/rendered/someuser/38/71?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736"
443+
"clickRecommended": "//event.perso.ibexa.co/api/723/clickrecommended/someuser/38/71?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736",
444+
"rendered": "//event.perso.ibexa.co/api/723/rendered/someuser/38/71?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736"
442445
},
443446
"attributes": [
444447
{
@@ -472,8 +475,8 @@ if the content Fields were previously exported by the export script.
472475
"itemType": 38,
473476
"relevance": 1,
474477
"links": {
475-
"clickRecommended": "//event.test.perso.ibexa.co/api/723/clickrecommended/someuser/38/75?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736",
476-
"rendered": "//event.test.perso.ibexa.co/api/723/rendered/someuser/38/75?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736"
478+
"clickRecommended": "//event.perso.ibexa.co/api/723/clickrecommended/someuser/38/75?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736",
479+
"rendered": "//event.perso.ibexa.co/api/723/rendered/someuser/38/75?scenario=popular&modelid=4199&categorypath=&requestuuid=d75e7cf0-e4ca-11e7-a94d-0a64dbbea736"
477480
},
478481
"attributes": [
479482
{

docs/personalization/integrate_recommendation_service.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The easiest way of embedding the tracking URL is placing a one pixel image on ev
2222
like in the case of analytical tools or visitor counters.
2323
A code that includes an image looks like this:
2424

25-
`<img href="https://event.perso.ibexa.co/ebl/00000/click/<user_ID>/<content_type_ID>/<content_ID>" width="1" height="1">`
25+
`<img href="https://event.perso.ibexa.co/api/00000/click/<user_ID>/<content_type_ID>/<content_ID>" width="1" height="1">`
2626

2727
where:
2828

@@ -39,19 +39,21 @@ PHP:
3939

4040
``` php
4141
$mandator_id = '00000';
42+
$content_type_id = '1';
4243
$product_id = '123';
4344
$server = '//event.perso.ibexa.co';
44-
$tracking = $server.'/ebl/'.$mandator_id.'/click/'.urlencode(session_id()).'/1/'.$product_id;
45+
$tracking = $server.'/api/'.$mandator_id.'/click/'.urlencode(user_id()).$content_type_id.$product_id;
4546
echo "<img href='$tracking' width='1' height='1'>";
4647
```
4748

4849
JavaScript:
4950

5051
``` js
5152
var mandator_id = '00000';
53+
var content_type_id = '1';
5254
var product_id = '123';
5355
var server = '//event.perso.ibexa.co';
54-
var url = server + '/api/' + mandator_id + '/click/' + getSessionId() + '/1/' + product_id;
56+
var url = server + '/api/' + mandator_id + '/click/' + getUserId() + content_type_id + product_id;
5557
var ycimg=new Image(1,1);
5658
ycimg.src=url;
5759
```
@@ -61,7 +63,7 @@ A similar tracking image can be placed on a confirmation page that ends the paym
6163
``` php
6264
$server = '//event.perso.ibexa.co';
6365
foreach ($just_bought_products as $product_id) {
64-
$tracking = $server.'/ebl/'.$mandator_id.'/buy/'.urlencode(session_id()).'/1/'.$product_id;
66+
$tracking = $server.'/api/'.$mandator_id.'/buy/'.urlencode(user_id()).$content_type_id.$product_id;
6567
echo "<img href='$tracking' width='1' height='1'>\n";
6668
}
6769
```
@@ -128,7 +130,7 @@ $mandator_id = '00000';
128130
$license_key = '67890-1234-5678-90123-4567';
129131
$server = "https://reco.perso.ibexa.co";
130132
$scenario = "category_page";
131-
$url = $server.'/ebl/00000/'.urlencode(session_id()).'/'.urlencode($scenario).'.json';
133+
$url = $server.'/api/v2/00000/'.urlencode(user_id()).'/'.urlencode($scenario).'.json';
132134

133135
$curl = curl_init();
134136
$request = array(

docs/personalization/tracking_integration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ where the event must be sent [pixel tracking](integrate_recommendation_service.m
1111
For example, with HTML: 
1212

1313
``` html
14-
<img href="https://event.perso.ibexa.co/ebl/00000/click/johndoe/1/100?categorypath=/a/ab/abc" width="1" height="1">
14+
<img href="https://event.perso.ibexa.co/api/00000/click/johndoe/1/100?categorypath=/a/ab/abc" width="1" height="1">
1515
```
1616

1717
or with JavaScript:
1818

1919
``` js
2020
<script type="text/javascript">
2121
var img = new Image(1,1);
22-
img.src = "https://event.perso.ibexa.co/ebl/00000/click/johndoe/1/100?categorypath=/a/ab/abc";
22+
img.src = "https://event.perso.ibexa.co/api/00000/click/johndoe/1/100?categorypath=/a/ab/abc";
2323
</script>
2424
```
2525

docs/personalization/tracking_with_ibexa-tracker.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ JavaScript in your site.
99
The approach is very generic and evaluate it if it meets your
1010
**requirements and security policy**.
1111

12-
If you want the `userid` to be generated automatically, leave out the user
13-
params in the `_ycq.push` calls.
12+
If you want the `userid` to be generated automatically, set user
13+
parameter as empty `''` in the `_ycq.push` calls.
1414
If a predefined cookie already exists, it is used.
1515
Otherwise a new one is created.
1616

@@ -32,7 +32,7 @@ the closing `</head>` tag.
3232
<script type="text/javascript">
3333
var _ycq = _ycq || [];
3434
_ycq.push(['_setMandator', '<YOUR_MANDATOR_ID>']);
35-
_ycq.push(['_trackEvent', '1', 'click', '<PAGE_ID>', '<USER_ID>']);
35+
_ycq.push(['_trackEvent', '<CONTENT_TYPE_ID>', 'click', '<CONTENT_ID>', '<USER_ID>']);
3636

3737
(function() {
3838
var yc = document.createElement('script');
@@ -85,17 +85,17 @@ Here is an example of typical usage of the method:
8585
``` js
8686
var _ycq = _ycq || [];
8787
_ycq.push(['_setMandator', '<YOUR_MANDATOR_ID>']);
88-
_ycq.push(['_trackEvent', '1', 'click', 'https://mydoc.pdf', 'user1234']);
88+
_ycq.push(['_trackEvent', '1', 'click', '10', '']);
8989
```
9090

9191
## Tracker object names
9292

93-
| Object | Description | Example |
94-
| --------------- | ------------- | ----- |
93+
| Object | Description | Example |
94+
| --------------- | ------------- | ------ |
9595
| `_setMandator ` | - Executed with one additional parameter: `MandatorId` | `_ycq.push (['_setMandator' , '<YOUR_MANDATOR_ID>']);` |
96-
| `_trackEvent` | - Executed with four additional parameters: `ItemType`, `EventType`, `ItemId`, `UserId`.<br /> - `EventType` can be any of the [described types]([[= user_doc =]]/personalization/event_types/) | capturing an event: `_ycq.push(['_trackEvent', '1', 'buy', 'https://mydoc.pdf', 'user1234x']);` |
97-
| `_trackTimedEvent` | - Executed with five additional parameters: `ItemType``EventType``ItemId`, `Timeout`, `UserId`.<br /> - `EventType` can be any of the [described types]([[= user_doc =]]/personalization/event_types/).<br /> - `Timeout` can be any integer greater than than 0 representing time in ms | consume event sent after 20s: `_ycq.push(['_trackTimedEvent', '1', 'consume', 'https://mydoc.pdf', '20000', 'user1234x']);` |
98-
| `_login` | - Executed with two additional parameters: anonymous userId, pseudonymous userId.<br /> - It is to be triggered when a user logs in and the tracking identity is changed.<br /> |-|
96+
| `_trackEvent` | - Executed with four additional parameters: `ItemType`, `EventType`, `ItemId`, `UserId`.<br /> - `EventType` can be any of the [described types]([[= user_doc =]]/personalization/event_types/) | capturing an event: `_ycq.push(['_trackEvent', '1', 'buy', '10', '']);` |
97+
| `_trackTimedEvent` | - Executed with five additional parameters: `ItemType``EventType``ItemId`, `Timeout`, `UserId`.<br /> - `EventType` can be any of the [described types]([[= user_doc =]]/personalization/event_types/).<br /> - `Timeout` can be any integer greater than 0 representing time in ms | consume event sent after 20s: `_ycq.push(['_trackTimedEvent', '1', 'consume', '10', '20000', '']);` |
98+
| `_login` | - Executed with two additional parameters: anonymous userId, pseudonymous userId.<br /> - It is to be triggered when a user logs in and the tracking identity is changed.<br /> | - |
9999
| `ycreco=true` | - If you want to send a click recommended event you can append the following parameter to the recommended item URLs: | [https://mydomain.com/mypage.html?ycreco=true](https://mydomain.com/mypage.html?ycreco=true) or <br />[https://mydomain.com/mypage.html?myparameter=x&ycreco=true](https://mydomain.com/mypage.html?myparameter=x&ycreco=true) |
100100

101101
## Tracking with HTML event handlers
@@ -104,7 +104,7 @@ The asynchronous tracking syntax should also be used from within DOM event handl
104104
For example, the following button generates an event when it is clicked:
105105

106106
``` js
107-
<button onclick = "_ycq.push(['_trackEvent', '2', 'click', 'itemId1', 'user1234x'])"/><button>
107+
<button onclick = "_ycq.push(['_trackEvent', '2', 'click', 'itemId1', ''])"/><button>
108108
```
109109

110110
Even if this button is clicked before the browser has finished loading `ibexa-tracker.js`,

0 commit comments

Comments
 (0)