API Reference / API Methods / Personalization / Add strategy
Feb. 26, 2019

Add Strategy

Required API Key: any key with the editSettings ACL
Method signature
$client->setPersonalizationStrategy(array strategy)

About this method

Set a personalization strategy for your application

Examples

1
2
3
4
5
6
7
8
9
10
$client->setPersonalizationStrategy([
    'eventsScoring' => [
        'Add to cart' => ['score' => 50, 'type' => 'conversion'],
        'Purchase' => ['score' => 100, 'type' => 'conversion']
    ],
    'facetsScoring' => [
        'brand' => ['score' => 100],
        'categories' => ['score' => 10]
    ]
]);

Parameters

strategy
type: object
Required

A strategy object.

{
  "eventScoring": eventsScoring,
  "facetsScoring": facetsScoring
}

strategy

eventsScoring
type: object
Required

Associate a score to an event

1
2
3
4
5
6
{
  "${eventName}": {
    "score": int // mandatory
    "type": string // mandatory
  }
}
facetsScoring
type: object
Required

Associate a score to a facet.

1
2
3
4
5
  {
    "${facetName}": {
      "score": int // mandatory
    }
  }

Response

No response

Did you find this page helpful?