Implementing Macros

3min

Macros allow you to pass information about the order into key elements of the Offer unit to both inform your customer about their completed transaction and optimize the MomentScience Offer for success.

MomentScience recommends the following macros which can be used during theme customization:

Macro

Usage

{{confirmationref}}

Used to pass the order/transaction confirmation number into the MomentScience Offer. This is helpful because it informs the user that their transaction was complete and focuses their attention on offers.

{{firstname}}

Used to pass the first name of the customer into the MomentScience Offer. This is valuable because it personalizes the MomentScience experience and offers deeper encouragement to consider the presented Offers.

{{payload_attribute}}

Any other payload attribute can be used as a macro for personalization for the MomentScience unit.



In order for macros to function, the corresponding parameter must be passed in the payload. For example, if you intend to use the {{confirmationref}} macro, you must ensure that a value for confirmationref is passed into the payload.

Examples of Macro Usage

Below is an example of macros being used to both personalize the MomentScience unit and inform the customer that their purchase was complete paving the way for an optimal experience.

Macros can be used when setting the MomentScience unit's Header and Lead-in Text when customising your themes.

Document image


The macros {{firstname}}, {{confirmationref}}, and {{amount}} are being used to personalize the message to the user.

For the given payload as provided in window.AdpxUser

JS


The macros would result in the following personalized experience:

Document image


📢 If you're running into any issues while going through the integration process, feel free to contact us at [email protected]