HomeGuidesAPI ReferenceGraphQL
Submit Documentation FeedbackJoin Developer CommunityOptimizely GitHubOptimizely NuGetLog 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.

'showContent', {
  contentId: '<insert_content_id>', 
  target: {
    selector: '<insert css selector>', // empty string for modals 
    position: 'modal' // modal | before | after | inside | replace



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

Did this page help you?