Pages

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from this space and version 19.3

...

ParameterDescriptionTypeRoleExample
method

Request type.

Use the value strategy.

StringRequired


Code Block
languagebash
themeRDark
method=strategy


origin

Site origin.

To find out your site's origin, see Getting your site origin.

StringRequired


Code Block
languagebash
themeRDark
origin=shop_company_com


strategyRecommendation strategy ID.StringRequired


Code Block
languagetext
themeRDark
strategy=product-page--recommended-for-you


cookieId

Local Frosmo ID of the visitor who sees the recommendation returned by the API request.

This parameter is required in the following cases:

  • The strategy requires a user context to generate the recommendation data.
  • The strategy is set to apply some level of visitor affinity.
  • You want to override the level of affinity that the strategy is set to apply. You must also define affinityPercentage.
  • You want to apply affinity to the recommendation even when the strategy is not set to apply affinity. You must also define affinityPercentage.

The strategy requires a user context if it uses any of the following algorithms:

  • Bought together with categories recently bought by the visitor
  • Bought together with items recently viewed by the visitor
  • Most viewed by the visitor
  • Recently viewed by the visitor
  • Viewed together with categories recently viewed by the visitor
  • Viewed together with items recently viewed by the visitor

The ID allows the platform to use the visitor's user context and affinity profile for personalizing the recommendation for the visitor.

This parameter has no effect if the strategy does not require a user context and is not set to apply affinity (either by the strategy itself or by affinityPercentage).

StringOptional


Code Block
languagetext
themeRDark
cookieId=dsr77t.kstzihlx


context

Information about the context into which the recommendation data is retrieved. The context consists of Contextual information about the current page ( where the API request is made).

The context information allows the API to return the correct recommendation data for the current page. The exact context information required depends on the page type of the recommendation strategy: the context information must match the page type.

You specify the context object using the JSON formatThe value is a JSON object.

Recommendation strategy context objectRequired


Code Block
languagebash
themeRDark
# Product page context

context={
  "page": {
    "product": {
      "id": "719",
      "category": "Books/Fiction/Fantasy"
    }
  }
}


variants

Define whether to also return the data for product variants.

If a product has one or more variants, the API returns the full product data for each variant in the variants array property of the recommended item object.

The possible values are:

  • false: Do not return product variant data.
  • true: Return product variant data.

The default value is false.

BooleanOptional


Code Block
languagebash
themeRDark
variants=true


affinityPercentage

Level of visitor affinity (in percentages) applied to the recommendation. The higher the level, the more personalized the set of recommended items is for each individual visitor.

The minimum value is 0 (no affinity applied, an algorithm fully determines how the items it returns are ranked). The maximum value is 100 (affinity fully determines how the items returned by an algorithm are ranked).

If defined, this parameter overrides the level of affinity set in the strategy.

This parameter has no effect unless cookieId is also defined.

NumberOptional


Code Block
languagebash
themeRDark
affinityPercentage=50


profile

Define the visitor's profiling choice if the site uses selective profiling. The choice determines whether the API returns recommendation data that is personalized for the visitor.

The possible values are:

  • opt-in: The visitor has opted in to seeing personalized, targeted content.
  • opt-out: The visitor has opted out of seeing personalized, targeted content.
  • Empty: The visitor has not made their profiling choice.

The default value is empty.

Each visitor's profiling choice is stored in their context. You can get the choice using the frosmo.easy.profile.get() function.

Note

You must always define this parameter on a site that uses selective profiling.

Never define this parameter on a site that does not use selective profiling.

How the profiling choice works

If you set the value to opt-in or empty, the API returns the recommendation data normally.

If you set the value to opt-out:

  • The API does not apply any visitor affinity to the recommendation. The API ignores the level of affinity set in the strategy and defined in affinityPercentage.
  • The API does not return recommendation data from algorithms that generate personalized results (such as a "by the visitor" algorithm).

Depending on the strategy settings, the API therefore either returns a non-personalized version of the recommendation or a recommendation with the personalized results removed.

StringOptional


Code Block
languagebash
themeRDark
profile=opt-out


shuffle

Define whether to randomly shuffle the order of items in the recommendation data.

By default, the items are in descending order of rank, with the most recommended item (as defined by the recommendation strategy) ranked highest.

The possible values are:

  • false: Do not shuffle the order of items.
  • true: Shuffle the order of items.

The default value is false.

Note

If any affinity is applied, shuffling is disabled, irrespective of the value of this parameter. Affinity is applied when cookieId is defined, and the level of affinity is set to greater than 0% either in the strategy or with affinityPercentage.


BooleanOptional


Code Block
languagebash
themeRDark
shuffle=true


debug

Define whether to return debugging information about the recommendation data.

Warning

Use the debugging information only for development and testing purposes. Do not use the information in production, since Frosmo does not guarantee that the information structure and content will remain the same.

The debugging information for a recommendation consists of:

The possible values are:

  • false: Do not return debugging information.
  • true: Return debugging information.

The default value is false.

BooleanOptional


Code Block
languagebash
themeRDark
debug=true


...

Code Block
languagejs
themeRDark
titleResponse structure with debugging information
{
  "data": [
    {<item 1 data>},
    {<item 2 data>},
    ...
    {<item n data>}
  ],
  "debug": [{
    <debugging information>
  ]}
}

If an item is a parent product with one or more product variants, and if the request is set to also return variants, the recommended item object includes the variants array, which contains the full product data for each variant.

...