۶Ƶ

Create code-based experiences create-code-based

In Journey Optimizer, you can create code-based experiences in a journey or a campaign.

Specific guardrails and recommendations for code-based experiences are detailed in this page.

Add a code-based experience through a journey or a campaign create-code-based-experience

To start building your code-based experience through a journey or a campaign, follow the steps below.

Add a code-based experience to a journey

To add a code-based experience activity to a journey, follow these steps:

  1. Create a journey.

  2. Start your journey with an Event or a Read Audience activity.

  3. Drag and drop a Code-based experience activity from the Actions section of the palette.

    note note
    NOTE
    As Code-based experience is an inbound message activity, it comes with a 3-days Wait activity. Learn more
  4. Enter a Label and Description for your message.

  5. Select or create the Code-based experience configuration to use.

  6. Select the Edit content button and edit your content as desired using the personalization editor. Learn more

    You can also use an existing content template as a basis for your code content. Note that the templates available to choose are scoped to either HTML or JSON based on the channel configuration that has been chosen beforehand. Learn how to use content templates

  7. If necessary, complete your journey flow by dragging and dropping additional actions or events. Learn more

  8. Once your code-base experience is ready, finalize the configuration and publish your journey to activate it. Learn more

For more information on how to configure a journey, refer to this page.

Create a code-based experience campaign

To start building your code-based experience through a campaign, follow the steps below.

  1. Create a campaign. Learn more

  2. Select the type of campaign that you want to execute

    • Scheduled - Marketing: execute the campaign immediately or on a specified date. Scheduled campaigns are aimed at sending marketing messages. They are configured and executed from the user interface.

    • API-triggered - Marketing/Transactional: execute the campaign using an API call. API-triggered campaigns are aimed at sending either marketing, or transactional messages, i.e. messages sent out following an action performed by an individual: password reset, cart purchase etc. Learn how to trigger a campaign using APIs

  3. Complete the steps to create a campaign, such as the campaign properties, audience, and schedule. For more information on how to configure a campaign, refer to this page.

  4. Select the Code-based experience action.

  5. Select or create the code-based experience configuration. Learn more

  6. Edit your content as desired using the personalization editor. Learn more

    You can also use an existing content template as a basis for your code content. Note that the templates available to choose are scoped to either HTML or JSON based on the channel configuration that has been chosen beforehand. Learn how to use content templates

For more information on how to configure a campaign, refer to this page.

➡️ Learn how to create a code-based experience campaign in this video

Edit the code content edit-code

  1. From the journey activity or the campaign edition screen, select Edit code.

  2. The personalization editor opens. It is a non-visual experience creation interface which allows you to author your code.

  3. You can switch the authoring mode from HTML to JSON, and vice versa.

    note caution
    CAUTION
    Changing the authoring mode will result in losing all of your current code, so make sure to switch modes before you start authoring.
  4. Enter your code as needed. You can leverage the Journey Optimizer personalization editor with all its personalization and authoring capabilities. Learn more

  5. You can add HTML or JSON expression fragments if needed. Learn how

    You can also save part of your code content as fragment. Learn how

  6. With code-based experiences, you can use the Decisioning feature. Select the Decision policy icon from the left bar and click Add decision policy. Learn more

  7. Click Save and close to confirm your changes.

Now as soon as your developer makes an API or SDK call to fetch content for the surface defined in your channel configuration, the changes will be applied to your web page or app.

How-to video video

The video below shows how to create a code-based experience campaign, configure its properties, test, and publish it.

recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76