Web modals and embeds
How to trigger custom scenarios for your web content using Optimizely Data Platform (ODP) Web SDK.
To manually display web content based on your own criteria, ODP provides an SDK method for your development team to utilize.
Web dialog boxes (modal)
You can trigger a dialog box in custom scenarios—such as when your customer adds an item to cart or logs in—by calling the dispatch() method.
zaius.dispatch(
'web',
'showContent', {
contentId: '<insert_content_id>',
target: {
selector: '<insert css selector>', // empty string for modals
position: 'modal' // modal | before | after | inside | replace
}
});
NoteYou must create and launch a campaign in ODP before this snippet will work. See The basics of campaign setup.
Web embeds
Web embeds are handled in the ODP application. See Manage web embeds.
Updated 4 days ago
