Render Target activities that use the form-based composer
Some Target implementations may use regional mboxes (now known as “scopes”) to deliver content from activities that use the form-based Experience Composer. If your at.js Target implementation uses mboxes, then you need to do the following:
- Update any references from your at.js implementation that use
getOffer()
orgetOffers()
to the equivalent Platform Web SDK methods. - Add code to trigger a
propositionDisplay
event so that an impression is counted.
Request and apply content on demand
Activities created using Target’s form-based composer and delivered to regional mboxes cannot be rendered automatically by the Platform Web SDK. Similar to at.js, offers delivered to specific Target locations need to be rendered on demand.
getOffer()
and applyOffer()
:- Execute
getOffer()
to request an offer for a location - Execute
applyOffer()
to render the offer to a specified selector - An activity impression is automatically incremented at the time of the
getOffer()
request
code language-javascript |
---|
|
applyPropositions
command:- Execute
sendEvent
command to request offers (propositions) for one or more locations (scopes) - Execute
applyPropositions
command with metadata object which supplies instructions for how to apply content to the page for each scope - Execute
sendEvent
command with eventType ofdecisioning.propositionDisplay
to track an impression
code language-javascript |
---|
|
The Platform Web SDK offers greater control for applying form-based activities to the page using the applyPropositions
command with a actionType
specified:
actionType
applyOffer()
applyPropositions
setHtml
replaceHtml
appendHtml
Refer to the dedicated documentation about rendering content using the Platform Web SDK for additional rendering options and examples.
Implementation example
The example page below builds upon the implementation outlined in the previous section, only it adds additional scopes to the sendEvent
command.
code language-html |
---|
|
Next, learn how to pass Target parameters using the Platform Web SDK.
note note |
---|
NOTE |
We are committed to helping you be successful with your Target migration from at.js to Web SDK. If you run into obstacles with your migration or feel like there is critical information missing in this guide, please let us know by posting in this Community discussion. |