Hi @SoufianeLa ,
In webSdk, you can use sendEvent command to request offers (propositions) for one or more locations (scopes). An alternate code for using getOffer() and applyOffer() in webSdk would be :
alloy("sendEvent", {
"decisionScopes": ["Homepage_regional_mbox"]
}).then(function(result) {
var retrievedPropositions = result.propositions;
// Render offer (proposition) to the #hero-banner selector by supplying extra metadata
return alloy("applyPropositions", {
"propositions": retrievedPropositions,
"metadata": {
// Specify each regional mbox or scope name along with a selector and actionType
"Homepage_regional_mbox": {
"selector": ".tracking-tight",
"actionType": "replaceHtml"
}
}
}).then(function(applyPropositionsResult) {
var renderedPropositions = applyPropositionsResult.propositions;
// Send the display notifications via sendEvent command
alloy("sendEvent", {
"xdm": {
"eventType": "decisioning.propositionDisplay",
"_experience": {
"decisioning": {
"propositions": renderedPropositions
}
}
}
});
});
});
For more such codes related to at.js VS webSDK , you can feel free to use this cheatsheet : https://dexata.co/adobe-target-commands-profilescripts-cheatsheet/
Best Regards,
Vaibhav Mathur