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.

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.

Test the code-based experience test-code-based-experience

To display a preview of your modified code-based experience, follow the steps below.

CAUTION
You must have test profiles available to simulate which offers will be delivered to them. Learn how to create test profiles.
  1. In the journey or campaign, from either the personalization editor or edit content screen, select Simulate content.

  2. Click Manage test profiles to select one or more test profiles.

  3. A preview of your modified code-based experience is displayed.

Detailed information on how to select test profiles and preview your content is available in this section.

Preview on device preview-on-device

When building code-based experiences for web pages or mobile apps, you can preview your personalized experiences right on your browser or on your mobile devices, in order to see how these experiences look on real devices.

WARNING
Preview on device is not available when using decision policies or personalization contextual attributes.
  1. From the Simulate screen, click the Open preview options button. The preview options depend on the platform selected in your code-based configuration.

  2. If you are using a Web platform in your code-based configuration, the Device preview URL read-only field is pre-filled with the URL entered for the current channel configuration.

    You can either:

    • Select the Copy link button and paste the link into a browser tab. You can also share the link with your team and stakeholders, who can preview the new experience in any browser before the changes go live.

    • Click Open in new tab to open the link in your current browser.

    • Scan the QR code with your mobile device to open the preview link on a mobile browser.

  3. If you are using Mobile platforms (iOS / Android) in your code-based configuration, the Deeplink read-only field is pre-filled with the Preview URL value entered in the channel configuration for the selected platform.

    Toggle between the iOS and Android tabs to preview your experience for the platform of your choice.

    You can either:

    • Select the Copy link button and share the link with your team and stakeholders, who can preview the new experience in any mobile browser before the changes go live.

    • Scan the QR code with your mobile device to open the preview link directly in the mobile application. You must enter the PIN on your device to establish the Assurance session.

      note note
      NOTE
      Adobe Experience Platform Assurance is a product from Adobe Experience Cloud to help you inspect, proof, simulate, and validate how you collect data or serve experiences in your mobile app. Learn more
  4. Preview links are generated for the selected test profile and, if you are using Content Experiment in your journey or campaign, for the selected treatment.

    When updating the content, or selecting a different test profile or treatment, the preview link is automatically refreshed. You can copy the link into different browser tabs, and compare the experiences.

Make your code-based experience live code-based-experience-live

IMPORTANT
If your campaign is subject to an approval policy, you will need to request approval in order to be able to activate your code-based experiences. Learn more

Once you defined your code-based experience and edited your content as desired using the code-based editor, you can activate your journey or campaign to make your changes visible to your audience.

You can also preview your code-based experience content before making it live. Learn more

NOTE
If you activate a code-based journey/campaign impacting the same pages as another journey or campaign which is already live, all the changes will be applied to your content.
If multiple code-based journeys or campaigns update the same element(s) of your content, the highest priority journey/campaign takes precedence.

Once your code-based journey or campaign is live, your app implementation team is responsible for making explicit API or SDK calls to fetch content for the surfaces defined in the selected code-based experience configuration. Learn more on the different customer implementations in this section.

Publish a code-based journey publish-code-based-journey

To make your code-based experience live from a journey, follow the steps below.

  1. Verify that your journey is valid and that there is no error. Learn more

  2. From the journey, select the Publish option, located in the top right drop-down menu.

    note note
    NOTE
    Learn more on publishing journeys in this section.

Your code-based journey takes the Live status and is now visible to the selected audience. Each recipient of your journey can see your modifications.

NOTE
After you click Publish, it can take up to 15 minutes for the changes to be available live.

Activate a code-based campaign activate-code-based-campaign

  1. From your code-based campaign, select Review to activate.

  2. Check and edit if needed the content, properties, configuration, audience and schedule.

  3. Select Activate.

    note note
    NOTE
    Learn more on activating campaigns in this section.

Your code-based campaign takes the Live status and is now visible to the selected audience. Each recipient of your campaign can see the modifications you added to your content.

NOTE
After you click Activate, it can take up to 15 minutes for your changes to be available live.
If you defined a schedule for your code-based campaign, it has the Scheduled status until the start date and time are reached.

Stop a code-based journey or campaign stop-code-based-experience

When a code-based experience is live, you can stop it to prevent your audience from seeing your modifications. Follow the steps below.

  1. Select a live journey or campaign from the respective list.

  2. Perform the relevant action according to your case:

    • From the campaign top menu, select Stop campaign.

    • From the journey top menu, click the More button and select Stop.

  3. The modifications you added will not be visible anymore to the audience you defined.

NOTE
Once a code-based journey or campaign is stopped, you cannot edit or activate it again. You can only duplicate it and activate the duplicated journey/campaign.
recommendation-more-help
b22c9c5d-9208-48f4-b874-1cefb8df4d76