Google Tag Manager

Forum Discussion

BruceH's avatar
BruceH
Collaborator
2 months ago

Testing nested event properties

Anyone know if it's possible to test a nested event/entry property in the "Preview & Test" section of an email template? Seems like you can only enter data for basic properties.

  • Divyesh's avatar
    Divyesh
    Collaborator

    According to the Braze documentation, nested objects (i.e. nested event properties) are fully supported for use in custom events and purchase events and can be used for personalization, message triggering, and segmentation. However, when it comes to the Preview & Test section, the interface is primarily designed to let you manually enter data for basic (top-level) properties. At this time, you cannot directly input or simulate nested JSON structures within the Preview & Test panel. In other words, while nested event properties work in live messages when the event payload includes them, you won’t be able to impersonate that nested structure solely via the Preview & Test input fields.

    To effectively test messages that rely on nested properties, you have a couple of workarounds:

    1. Use Advanced Event Properties in your personalization setup. When you add personalization via the “Add Personalization” modal in the Braze dashboard, you can select Advanced Event Properties. This allows you to reference nested event data once a schema has been generated (typically from actual incoming events that contain nested JSON data).
    2. Trigger a test campaign or Canvas that uses an actual API event payload which includes your nested data. This way, the message rendering will have access to the nested structure as processed by Braze.

    For more details on implementing nested objects with custom events and purchases, please refer to the official Braze documentation on nested objects: [Braze Nested Objects Documentation](https://www.braze.com/docs/developer_guide/data/nested_objects/).

    I hope this clarifies the current functionality.

  • An alternate approach is to setup and sent test events using postman or similar.

  • I believe Arso 's second point is what you were asking, BruceH , is that correct?

    Regardless, yes, it's definitely a bit finicky, but we have successfully inserted entire objects inside the single-line custom field under the Preview page. I think Arrays of Objects didn't work so well, but I'd have to confirm again. 

  • As long as you're referencing the nested event property in the template, once you go to "Preview & Test" you could enter a value to test. The easiest way to reference a nested property is shown on the screenshot below. 

    You could also just reference the main property of the event that contains the nested object and paste the object value in the "Preview & Test" section's variable. This is if you need to confirm how it renders and how you can extract data from the object.