Render Target activities that use the form-based composer
Some Target implementations may use regional mboxes (now known as 鈥渟copes鈥) 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
propositionDisplayevent so that an impression is counted.
Request and apply content on demand
Activities created using Target鈥檚 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
sendEventcommand to request offers (propositions) for one or more locations (scopes) - Execute
applyPropositionscommand with metadata object which supplies instructions for how to apply content to the page for each scope - Execute
sendEventcommand with eventType ofdecisioning.propositionDisplayto 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:
actionTypeapplyOffer()applyPropositionssetHtmlreplaceHtmlappendHtmlRefer 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 . |