HomeGuidesAPI Reference
Submit Documentation FeedbackJoin Developer CommunityLog In

Web Modals/Embeds

This topic describes how to trigger custom scenarios for your web content using Optimizely Data Platform (ODP).

To manually display web content based on your own criteria, ODP provides an SDK method for your development team to utilize.

Using this snippet, you can trigger a modal in custom scenarios. For example, when your customer adds an item to cart or logs in.

zaius.dispatch(
'web', 
'showContent', {
  contentId: '<insert_content_id>', 
  target: {
    selector: '<insert css selector>', // empty string for modals 
    position: 'modal' // modal | before | after | inside | replace
  }
});

๐Ÿ“˜

Note

A campaign must be created and launched within ODP before this snippet will work.


Did this page help you?