Macros

A macro is used as a key that represents a command or action. Using macros allows you to collect more data about clicks that your campaign generates based on interest.

Macros are formatted using the ${MACRO_NAME} syntax, where MACRO_NAME is the name of the macro you want to use. For example, ${FALLBACK_NOTIFICATION} or ${LANDING_SUFFIX}.

System vs Dynamic Macros

System macros are predefined macros built into the platform and automatically available for use.

Dynamic macros are custom macros that users create and configure.

System macros

System macros are predefined macros that are built into the platform and automatically available for use in your campaigns. These macros provide access to campaign data, profile information, and tracking parameters without requiring any setup or configuration.

The following system macros are available for use in campaigns:

Macro NameDescription
OCMH_UTM_MEDIUMChannel used for customer engagement.
OCMH_CAMPAIGN_NAMECampaign Name.
OCMH_CAMPAIGN_IDCampaign ID.
OCMH_PROFILE_IDProfile’s ID.
OCMH_PROFILE_COUNTRY_CODEProfile’s country code.
OCMH_PROFILE_CITY_IDProfile’s city ID.
OCMH_PROFILE_LANG_CODEProfile’s language code.
OCMH_CONTAINER_IDContainer ID.
OCMH_CONTAINER_TYPEType of container.
OCMH_CLICK_IDClick ID.
OCMH_APP_NAMEName of app.
OCMH_UTM_SOURCEUTM source.
OCMH_PROFILE_AGEProfile’s age.
OCMH_PROFILE_SUBTIMEProfile’s subscription time.
OCMH_PROFILE_TIMEZONEProfile’s timezone.
OCMH_PROFILE_BROWSER_IDProfile’s browser ID.
OCMH_PROFILE_OS_IDProfile’s operating system ID.
OCMH_PROFILE_REGION_IDProfile’s region ID.

Dynamic macros

Dynamic macros are custom macros that users create and configure to adapt content based on contextual fields such as country, language, campaign IDs, or other audience traits. These macros allow messages to automatically adapt for each recipient based on their profile data.

Highlights

  • Full support for dynamic macros across campaigns
  • Automatic value resolution based on contextual fields (country, language, IDs, audience attributes)
  • Management of individual macro records (add, update, remove) without rebuilding the macro

Access Dynamic macros

  • Click the cogwheel icon in the top-right corner → Macros, or open Campaigns and use the Macros shortcut button.
  • Click the Add button in the top-right corner to create a new dynamic macro.
  • Use the quick filters to switch between System and Dynamic macros.

Create a new Dynamic macro

  1. Click Add.
  2. Fill in the Name (auto-capitalized and not editable later) and Description.
  3. Drag the fields that determine the macro value into the Fields panel. You can combine up to three fields. Available fields include Language and Country for basic plan users, and add-on fields such as Configuration ID, Configuration Group, Campaign ID, Partner ID, Experiment ID, and Profile age.
  4. Define the Default value (default_value). This is served whenever no record matches the incoming context.
  5. Records serve as a way to get the concrete value for the dynamic macro. For example, when a campaign is sent and a user receives it, if the configuration ID, campaign ID, and country match the defined criteria, the corresponding value specified in the record will be shown.
  6. Click Confirm. The macro appears in the list immediately.

Dynamic macros overview

Dynamic macro creation overview


Manage existing macros

  • Open any macro to edit the description, default value, or records. The name and selected fields stay locked.
  • Add, update, or remove individual records without rebuilding the macro.
  • Use the activity log to see who edited the macro and when.
Note
Once you have selected and saved the fields that will be used in the macro records, those fields cannot be changed or updated. The field selection is permanent for that macro. If you need to use different fields, you must create a new macro with the desired field combination.

Example

To provide a better experience when timeouts or network issues occur, the fallback notification can be localized so that it matches the user’s browser language. The following end-to-end scenario shows how to configure that flow with dynamic macros.

Step 1: Profiles per Language

Profiles represent the users who receive notifications. The language is automatically detected from the browser or can be manually set through the SDK. For this illustration, consider three profiles, each with a different language:

  • Profile 1: Language set to en (English browser)
  • Profile 2: Language set to es (Spanish browser)
  • Profile 3: Language set to fr (French browser)

Step 2: Create Dynamic Macro

  1. Navigate to Macros and click Add.
  2. Name the macro FALLBACK_NOTIFICATION and describe its purpose (e.g., “Localized fallback content for timeouts”).
  3. Drag the Language field into the Fields panel so the macro keys off the user’s browser language.
  4. Define the default value: “We’re sorry, something went wrong. Please try again.”
  5. Add localized records so the copy matches each browser language:
    • Language: en → “We’re sorry, something went wrong. Please try again.”
    • Language: es → “Lo sentimos, algo salió mal. Intenta de nuevo.”
    • Language: fr → “Nous sommes désolés, un problème est survenu. Veuillez réessayer.”
  6. Click Confirm to save the macro.

Create Dynamic Macro

Creating the FALLBACK_NOTIFICATION dynamic macro


Step 3: Create Template Message With Macros

  1. When creating or editing a campaign, select or create a new template message.
  2. In the template message editor, you can apply macros to the following fields:
    • Title
    • Body
    • Landing URL
    • Icon
    • Image
    • Action buttons (Title, Landing URL, Icon)
  3. Use the FALLBACK_NOTIFICATION macro in the Body field to provide localized fallback content.

Step 4: Localized Fallback Notifications

When timeouts or network issues occur, each profile receives the fallback notification localized to match their browser language:

Notification Profile 1 - English

Profile 1 sees the fallback in English

Notification Profile 2 - Spanish

Profile 2 sees the fallback in Spanish

Notification Profile 3 - French

Profile 3 sees the fallback in French


The macro resolves based on each profile’s language setting, ensuring the fallback matches the user’s preferred language, even when the primary notification cannot be delivered.