ÃÛ¶¹ÊÓƵ

applyPropositions

The applyPropositions command allows you to re-render propositions that were already rendered using the sendEvent command. This command is useful when working with single-page applications where portions of the page get re-rendered, potentially overwriting any personalizations already applied to the page.

This command supports the following fields:

  • Propositions: An array of proposition objects that you want to re-render.

  • View name: The name of the view to render. The display notifications for these decisions are cached and can be included in a subsequent sendEvent command using the personalization.includeRenderedPropositions option.

  • Meta data: An object that determines how HTML offers can be applied. It contains the following properties:

    • Scope
    • Selector
    • Action type

Apply propositions using the Web SDK tag extension

Applying propositions is performed as an action within a rule in the ÃÛ¶¹ÊÓƵ Experience Platform Data Collection tags interface.

  1. Log in to using your ÃÛ¶¹ÊÓƵ ID credentials.
  2. Navigate to Data Collection > Tags.
  3. Select the desired tag property.
  4. Navigate to Rules, then select the desired rule.
  5. Under Actions, select an existing action or create an action.
  6. Set the Extension dropdown field to ÃÛ¶¹ÊÓƵ Experience Platform Web SDK, and set the Action Type to Apply propositions.
  7. Set the desired fields on the right.
  8. Click Keep Changes, then run your publishing workflow.

Apply propositions using the Web SDK JavaScript library

Run the applyPropositions command when calling your configured instance of the Web SDK. The object containing configuration options supports the following fields:

  • propositions: An array of proposition objects that you want to re-render. This object typically isn’t used, as the propositionScopes field usually determines which scopes or surfaces that you want to re-render.

  • metadata: Determines how HTML offers are applied. It is a map where the key is a scope or a surface, and the value is an object containing the keys selector and actionType.

    • selector: A string containing a CSS selector of where to apply the HTML.
    • actionType: The action to take with the HTML. Valid values include setHtml, replaceHtml, and appendHtml.
  • viewName: The name of the view to render in a single-page application. The display notifications for these decisions are cached and can be included in a subsequent sendEvent command using personalization.includeRenderedPropositions.

alloy("applyPropositions",{
  "propositions": [],
  "metadata": {},
  "viewName": ""
});
recommendation-more-help
ad108910-6329-42f1-aa1d-5920a2b13636