Author: shuber
Date: Fri Jun  5 15:17:45 2020
New Revision: 1878518

URL: http://svn.apache.org/viewvc?rev=1878518&view=rev
Log:
Site checkin for project Apache Unomi :: Root Project

Modified:
    unomi/website/manual/1_1_x/index.html
    unomi/website/manual/1_2_x/index.html
    unomi/website/manual/1_3_x/index.html
    unomi/website/manual/1_4_x/index.html
    unomi/website/manual/1_5_x/index.html
    unomi/website/manual/latest/index.html

Modified: unomi/website/manual/1_1_x/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/1_1_x/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/1_1_x/index.html (original)
+++ unomi/website/manual/1_1_x/index.html Fri Jun  5 15:17:45 2020
@@ -1722,7 +1722,7 @@ done by disabling the elasticsearch auto
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 19:49:52 UTC
+Last updated 2020-05-14 16:06:48 +0200
 </div>
 </div>
 </body>

Modified: unomi/website/manual/1_2_x/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/1_2_x/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/1_2_x/index.html (original)
+++ unomi/website/manual/1_2_x/index.html Fri Jun  5 15:17:45 2020
@@ -2821,7 +2821,7 @@ definition file.</p>
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 19:49:52 UTC
+Last updated 2020-05-14 16:06:48 +0200
 </div>
 </div>
 </body>

Modified: unomi/website/manual/1_3_x/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/1_3_x/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/1_3_x/index.html (original)
+++ unomi/website/manual/1_3_x/index.html Fri Jun  5 15:17:45 2020
@@ -3401,7 +3401,7 @@ definition file.</p>
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 19:49:52 UTC
+Last updated 2020-05-14 16:06:48 +0200
 </div>
 </div>
 </body>

Modified: unomi/website/manual/1_4_x/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/1_4_x/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/1_4_x/index.html (original)
+++ unomi/website/manual/1_4_x/index.html Fri Jun  5 15:17:45 2020
@@ -6145,7 +6145,7 @@ They allow to modify an item, that would
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 19:49:52 UTC
+Last updated 2020-05-14 16:06:48 +0200
 </div>
 </div>
 </body>

Modified: unomi/website/manual/1_5_x/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/1_5_x/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/1_5_x/index.html (original)
+++ unomi/website/manual/1_5_x/index.html Fri Jun  5 15:17:45 2020
@@ -8698,7 +8698,7 @@ They allow to modify an item, that would
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 21:04:26 UTC
+Last updated 2020-06-05 17:02:03 +0200
 </div>
 </div>
 </body>

Modified: unomi/website/manual/latest/index.html
URL: 
http://svn.apache.org/viewvc/unomi/website/manual/latest/index.html?rev=1878518&r1=1878517&r2=1878518&view=diff
==============================================================================
--- unomi/website/manual/latest/index.html (original)
+++ unomi/website/manual/latest/index.html Fri Jun  5 15:17:45 2020
@@ -6477,13 +6477,14 @@ information about the context for the cu
 </div>
 <div class="listingblock">
 <div class="content">
-<pre class="highlight"><code class="language-json" data-lang="json">{
+<pre class="highlight"><code>{
   "profileId":&lt;identifier of the profile associated with the current 
user&gt;,
   "sessionId":&lt;identifier of the current user session&gt;,
   "profileProperties":&lt;requested profile properties, if any&gt;,
   "sessionProperties":&lt;requested session properties, if any&gt;,
   "profileSegments":&lt;segments the profile is part of if requested&gt;,
-  "filteringResults":&lt;result of the evaluation of personalization 
filters&gt;,
+  "filteringResults":&lt;result of the evaluation of content filters&gt;,
+  "personalizations":&lt;result of the evaluation of personalization 
filters&gt;,
   "trackedConditions":&lt;tracked conditions in the source page, if any&gt;
 }</code></pre>
 </div>
@@ -6587,17 +6588,19 @@ information about the context for the cu
 <div class="listingblock">
 <div class="content">
 <pre class="highlight"><code>{
-    source: &lt;Item source of the context request&gt;,
-    events: &lt;optional array of triggered events&gt;,
-    requiredProfileProperties: &lt;optional array of property identifiers&gt;,
-    requiredSessionProperties: &lt;optional array of property identifiers&gt;,
+    "sessionId" : &lt;optional session identifier&gt;,
+    "source": &lt;Item source of the context request&gt;,
+    "events": &lt;optional array of events to trigger&gt;,
+    "requiredProfileProperties": &lt;optional array of property 
identifiers&gt;,
+    "requiredSessionProperties": &lt;optional array of property 
identifiers&gt;,
     filters: &lt;optional array of filters to evaluate&gt;,
-    profileOverrides: &lt;optional profile containing segments,scores or 
profile properties to override&gt;,
-            - segments: &lt;optional array of segment identifiers&gt;,
-            - profileProperties: &lt;optional map of property name / value 
pairs&gt;,
-            - scores: &lt;optional map of score id / value pairs&gt;
-    sessionPropertiesOverrides: &lt;optional map of property name / value 
pairs&gt;,
-    requireSegments: &lt;boolean, whether to return the associated segments&gt;
+    "personalitations": &lt;optional array of personalizations to evaluate&gt;,
+    "profileOverrides": &lt;optional profile containing segments,scores or 
profile properties to override&gt;,
+        - segments: &lt;optional array of segment identifiers&gt;,
+        - profileProperties: &lt;optional map of property name / value 
pairs&gt;,
+        - scores: &lt;optional map of score id / value pairs&gt;
+    "sessionPropertiesOverrides": &lt;optional map of property name / value 
pairs&gt;,
+    "requireSegments": &lt;boolean, whether to return the associated 
segments&gt;
 }</code></pre>
 </div>
 </div>
@@ -6613,7 +6616,188 @@ information about the context for the cu
 <div class="sect5">
 <h6 id="_filters">Filters</h6>
 <div class="paragraph">
-<p>A client wishing to perform content personalization might also specify 
filtering conditions to be evaluated by the context server so that it can tell 
the client whether the content associated with the filter should be activated 
for this profile/session. This is accomplished by providing a list of filter 
definitions to be evaluated by the context server via the <code>filters</code> 
field of the payload. If provided, the evaluation results will be provided in 
the <code>filteringResults</code> field of the resulting <code>cxs</code> 
object the context server will send.</p>
+<p>A client wishing to perform content personalization might also specify 
filtering conditions to be evaluated by the
+context server so that it can tell the client whether the content associated 
with the filter should be activated for
+this profile/session. This is accomplished by providing a list of filter 
definitions to be evaluated by the context
+server via the <code>filters</code> field of the payload. If provided, the 
evaluation results will be provided in the
+<code>filteringResults</code> field of the resulting <code>cxs</code> object 
the context server will send.</p>
+</div>
+<div class="paragraph">
+<p>Here is an example of a filter request:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code>curl --location --request POST 
'http://localhost:8181/context.json' \
+--header 'Content-Type: application/json' \
+--header 'Cookie: JSESSIONID=48C8AFB3E18B8E3C93C2F4D5B7BD43B7; 
context-profile-id=01060c4c-a055-4c8f-9692-8a699d0c434a' \
+--data-raw '{
+    "source": null,
+    "requireSegments": false,
+    "requiredProfileProperties": null,
+    "requiredSessionProperties": null,
+    "events": null,
+    "filters": [
+       {
+               "id" : "filter1",
+               "filters" : [
+                       {
+                               "condition": {
+                    "parameterValues": {
+                        "propertyName": "properties.gender",
+                        "comparisonOperator": "equals",
+                        "propertyValue": "male"
+                    },
+                    "type": "profilePropertyCondition"
+                }
+                       }
+               ]
+       }
+    ],
+    "personalizations": null,
+    "profileOverrides": null,
+    "sessionPropertiesOverrides": null,
+    "sessionId": "demo-session-id"
+}'</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>And here&#8217;s the result:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-json" data-lang="json">{
+    "profileId": "01060c4c-a055-4c8f-9692-8a699d0c434a",
+    "sessionId": "demo-session-id",
+    "profileProperties": null,
+    "sessionProperties": null,
+    "profileSegments": null,
+    "filteringResults": {
+        "filter1": false
+    },
+    "processedEvents": 0,
+    "personalizations": null,
+    "trackedConditions": [],
+    "anonymousBrowsing": false,
+    "consents": {}
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>As we can see, the <code>filter1</code> filter we sent in our request, in 
this example, evaluated to false for the current profile,
+so we can use that result to perform any customization for the current 
profile, in this case use the fact that he is
+male.</p>
+</div>
+</div>
+<div class="sect5">
+<h6 id="_personalizations">Personalizations</h6>
+<div class="paragraph">
+<p>Filters make it possible to evaluate conditions against a profile in 
real-time, but for true personalization it is needed
+to have a more powerful mechanism: strategies. Sometimes we want to provide 
multiple variants that each have their own
+conditions and we want to know which is the best variant to use for the 
current profile. This can be achieved with the
+<code>personalizations</code> structure in the ContextRequest.</p>
+</div>
+<div class="paragraph">
+<p>Here is an example of a <code>personalizations</code> request:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code>curl --location --request POST 
'http://localhost:8181/context.json' \
+--header 'Content-Type: application/json' \
+--header 'Cookie: JSESSIONID=48C8AFB3E18B8E3C93C2F4D5B7BD43B7; 
context-profile-id=01060c4c-a055-4c8f-9692-8a699d0c434a' \
+--data-raw '{
+    "source": null,
+    "requireSegments": false,
+    "requiredProfileProperties": null,
+    "requiredSessionProperties": null,
+    "events": null,
+    "filters": null,
+    "personalizations": [
+        {
+            "id": "gender-test",
+            "strategy": "matching-first",
+            "strategyOptions": {
+                "fallback": "var2"
+            },
+            "contents": [
+                {
+                    "id": "var1",
+                    "filters": [
+                        {
+                            "appliesOn": null,
+                            "condition": {
+                                "parameterValues": {
+                                    "propertyName": "properties.gender",
+                                    "comparisonOperator": "equals",
+                                    "propertyValue": "male"
+                                },
+                                "type": "profilePropertyCondition"
+                            },
+                            "properties": null
+                        }
+                    ],
+                    "properties": null
+                },
+                {
+                    "id": "var2",
+                    "filters": null,
+                    "properties": null
+                }
+            ]
+        }
+    ],
+    "profileOverrides": null,
+    "sessionPropertiesOverrides": null,
+    "sessionId": "demo-session-id"
+}'</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>In the above example, we basically setup two variants : <code>var1</code> 
and <code>var2</code> and setup the <code>var2</code> to be the fallback variant
+in case no variant is matched. We could of course specify more than a variant. 
The <code>strategy</code> indicates to the
+personalization service how to calculate the "winning" variant. In this case 
the strategy <code>matching-first</code> will return
+the first variant that matches the current profile.</p>
+</div>
+<div class="paragraph">
+<p>Currently the following strategies are available:</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p><code>matching-first</code>: will return the first matching variant.</p>
+</li>
+<li>
+<p><code>random</code>: will return a random variant</p>
+</li>
+<li>
+<p><code>score-sorted</code>: allows to sort the variants based on scores 
associated with the filtering conditions, effectively
+sorting them by the highest scoring condition first.</p>
+</li>
+</ul>
+</div>
+<div class="paragraph">
+<p>Here is the result of the above example:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="highlight"><code class="language-json" data-lang="json">{
+    "profileId": "01060c4c-a055-4c8f-9692-8a699d0c434a",
+    "sessionId": "demo-session-id",
+    "profileProperties": null,
+    "sessionProperties": null,
+    "profileSegments": null,
+    "filteringResults": null,
+    "processedEvents": 0,
+    "personalizations": {
+        "gender-test": [
+            "var2"
+        ]
+    },
+    "trackedConditions": [
+    ],
+    "anonymousBrowsing": false,
+    "consents": {}
+}</code></pre>
+</div>
 </div>
 </div>
 <div class="sect5">
@@ -8698,7 +8882,7 @@ They allow to modify an item, that would
 </div>
 <div id="footer">
 <div id="footer-text">
-Last updated 2020-05-14 19:49:53 UTC
+Last updated 2020-06-05 17:02:03 +0200
 </div>
 </div>
 </body>


Reply via email to