> ## Documentation Index
> Fetch the complete documentation index at: https://algolia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get strategy

> Get the personalization strategy.

export const Legacy = ({title, href}) => {
  return <Note>

    This page documents an earlier version of the API client.
    For the latest version, see <a href={href}>{title}</a>.

    </Note>;
};

<Legacy title="Retrieve the personalization strategy" href="/doc/libraries/sdk/methods/personalization/get-personalization-strategy" />

**Required ACL:** `settings`

## Examples

<CodeGroup>
  ```cs C# theme={"system"}
  var strategy = client.GetPersonalizationStrategy();

  // Asynchronous
  var strategy = await client.GetPersonalizationStrategyAsync();
  ```

  ```go Go theme={"system"}
  strategy, err := client.GetPersonalizationStrategy()
  ```

  ```java Java theme={"system"}
  GetStrategyResponse result = client.getPersonalizationStrategy();

  // Asynchronous
  CompletableFuture<GetStrategyResponse> result = 
    client.getPersonalizationStrategyAsync();
  ```

  ```js JavaScript theme={"system"}
  client
    .initPersonalization()
    .getPersonalizationStrategy()
    .then((personalizationStrategy) => {
      console.log(personalizationStrategy);
    });
  ```

  ```kotlin Kotlin theme={"system"}
  client.getPersonalizationStrategy()
  ```

  ```php PHP theme={"system"}
  $strategy = $client->getPersonalizationStrategy();
  ```

  ```python Python theme={"system"}
  strategy = client.get_personalization_strategy()
  ```

  ```ruby Ruby theme={"system"}
  client = Algolia::Recommendation::Client.create("YourApplicationID", "YourWriteAPIKey")

  strategy = client.get_personalization_strategy
  ```

  ```scala Scala theme={"system"}
  client.execute {
    get personalizationStrategy
  }
  ```

  ```swift Swift theme={"system"}
  personalizationClient.getPersonalizationStrategy { result in
    if case .success(let response) = result {
      print("Response: \(response)")
    }
  }
  ```
</CodeGroup>

## Parameters

<ParamField body="requestOptions" type="object">
  A mapping of request options to send along with the request.
</ParamField>

## Response

<ResponseField name="eventsScoring" type="object[]">
  Score associated to each event.

  **Example:**

  ```json JSON icon=braces theme={"system"}
  {
    "eventsScoring": [
      {
        "eventName": "purchase"
        "eventType": "conversion"
        "score": 100
      }
    ]
  }
  ```

  <Expandable>
    <ResponseField name="eventName" type="string">
      Event name.
    </ResponseField>

    <ResponseField name="eventType" type="string">
      Event type: `click`, `conversion`, or `view`.
    </ResponseField>

    <ResponseField name="score" type="number">
      Score for this event.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="facetsScoring" type="object[]">
  Score associated to each facet.

  ```json JSON icon=braces theme={"system"}
  {
    "facetsScoring": [
      {
        "facetName": "brand",
        "score": 100
      }
    ]
  }
  ```

  <Expandable>
    <ResponseField name="facetName" type="string">
      Facet name.
    </ResponseField>

    <ResponseField name="score" type="number">
      Score of this facet.
    </ResponseField>
  </Expandable>
</ResponseField>

### Response as JSON

This section shows the JSON response returned by the API.
Each API client wraps this response in language-specific objects, so the structure may vary.
To view the response, use the `getLogs` method.
Don't rely on the order of properties—JSON objects don't preserve key order.

```jsonc JSON icon=braces theme={"system"}
{
  "eventsScoring": [
    {
      "eventName": "purchase"
      "eventType": "conversion"
      "score": 100
    }
  ],
  "facetsScoring": [
    {
      "facetName": "brand",
      "score": 100
    }
  ]
}
```
