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.
To add a code-based experience activity to a journey, follow these steps:
-
Start your journey with an Event or a Read Audience activity.
-
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 -
Enter a Label and Description for your message.
-
Select or create the Code-based experience configuration to use.
-
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
-
If necessary, complete your journey flow by dragging and dropping additional actions or events. Learn more
-
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.
To start building your code-based experience through a campaign, follow the steps below.
-
Create a campaign. Learn more
-
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
-
-
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.
-
Select the Code-based experience action.
-
Select or create the code-based experience configuration. Learn more
-
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
-
From the journey activity or the campaign edition screen, select Edit code.
-
The personalization editor opens. It is a non-visual experience creation interface which allows you to author your code.
-
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. -
Enter your code as needed. You can leverage the Journey Optimizer personalization editor with all its personalization and authoring capabilities. Learn more
-
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
-
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
-
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.