Get started with code-based channel get-started-code-based

On this page: Discover how the code-based channel lets you deliver personalized content to granular locations across your apps and web pages, and when to use it instead of other channels.

Journey Optimizer allows you to personalize and test the experiences you want to deliver to your customers across all your touchpoints like: web apps, mobile apps, desktop apps, video consoles, TV connected devices, smart TVs, kiosks, ATMs, voice assistants, IoT devices, etc.

With the code-based experience capability, you can define inbound experiences using a simple and intuitive non-visual editor. It allows you to insert and edit specific elements at individual and more granular locations of your apps or web pages, no matter the type of applications you have - rather than applying modifications to an entire content.

IMPORTANT
Specific recommendations for code-based experiences are detailed on this page.

➡️ An end-to-end use case showing how to use content experiments to compare decisions with the code-based experience channel is presented in this section.

Use cases use-cases

The code-based channel works best when your use case goes beyond what a visual editor can support, and you have development resources available to build and maintain the implementation.

Benefit
Why
Example use cases
Deep personalization
Supports complex logic and real-time data beyond what visual editors expose
Personalization driven by real-time inventory or user context
Integration with external systems
Content can be composed using data from outside systems
Weather-based promotions, real-time inventory-driven offers
Advanced, multi-step conditional workflows
Not limited to the pre-defined actions of visual channels
Multi-step decisioning logic across touchpoints
Going beyond platform limits
Lets developers build custom interactive elements
Custom UI components not supported by out-of-the-box channels
Improved campaign flexibility
Content and logic are defined by your own implementation
Headless, API-based, or non-browser digital properties

When not to use when-not-to-use

The code-based channel requires development effort, so it is not the right choice for every scenario. Consider another channel in the following situations:

  • Your campaign is quick or simple and can be built with a no-code channel like web or in-app, without any development effort
  • You do not have developer resources or a testing environment available to build and validate a custom implementation
  • Your timeline or budget is limited for custom development, since code-based experiences require more upfront planning
  • Standard messaging already fits the built-in channel capabilities, making custom development unnecessary
  • Long-term maintainability of custom code is a concern, since surfaces and implementations need ongoing developer support

When to use code-based vs. other channels code-based-vs-other-channels

Code-based vs. other channels

When to use the code-based channel rather than the other Journey Optimizer channels?

  • You can consider using code-based experiences any time when your digital property is not accessed through a web browser or a mobile app – cases in which you can probably better use the Journey Optimizer web channel or the Journey Optimizer in-app messaging channel.
  • You can use the code-based channel as an alternative to the Journey Optimizer web or in-app channels in case you have an API-based, headless or server-side implementation.

  • You can also leverage the code-based channel on native mobile applications as an alternative to the in-app channel if you want to modify the content inside your native app instead of showing modals, popups or overlays.

Code-based vs. web channel code-based-vs-web

To execute web use cases, you can use either the web channel or code-based experience, but depending on your context one would be more appropriate than the other. The main differences are listed below so you can make an informed decision on what to use, and when.

Web

  • The web channel lets you modify everything on your page and has a pre-defined list of actions you can use to make changes. Learn more
  • It is easy to set up and get going fast.
  • It is marketer-persona focused.

Code-based experience

  • Edit your content using the personalization editor.
  • You need either the Adobe Experience Platform Web SDK – client-side implementation, or the the AEP Edge Network Server API – server-side implementation.
  • The code-based experience requires previous development work on your implementation to make sure that your applications can interpret and deliver the content published on the edge by Journey Optimizer for these locations. Learn more
  • It requires more planning and it can change only the things that developers specify. Therefore, it is essential to identify the components (home banner, hero image, menu bar, etc.) on the applications that need to be modified for personalization or testing, and work with your development team to build the implementation needed for handling these changes.
  • It allows you to use JSON code content.
  • It is developer-persona focused.

How it works how-it-works

CAUTION
This feature is for developer persona and/or experienced users. It can be used by marketers with some code-writing skills, as long as the channel configurations and initial setup are handled by your development team.

To edit your content using the Journey Optimizer code-based experience feature, your pages or apps need to be instrumented. To do so, you must declare upfront the specific individual locations (called “surfaces”) where you want to insert or replace content.

NOTE
Currently the content associated with a configuration can only be HTML or JSON.

The key steps to create and deliver a code-based experience are as follows.

  1. Make sure you follow the channel-specific prerequisites. Learn more

  2. Define a surface in your application implementation, which is basically the location where you want to add your experience.

  3. Create a code-based channel configuration that references that location. Learn how

  4. Create a journey or campaign in Journey Optimizer using this configuration. Learn how

  5. Compose an experience by specifying content for the selected configuration using the Journey Optimizer personalization editor. Learn how

  6. Test your code-based experience. Learn how

  7. Publish it. Learn how

  8. Once your code-based experience journey or campaign is live, the app or page implementation that requests content for the surface must be in place for the content to be retrieved and displayed.

    note info
    INFO
    To ensure this, your app implementation team makes explicit API or SDK calls to fetch content for the surface defined in the code-based configuration, such as “Banner Text” or “Recommendations Tray 1”, or non-UI-related decision points in an application, such as “search algorithm parameters”. Learn more

Additional resources

recommendation-more-help
journey-optimizer-help