Skip to main content

Dynamic data in nudges

One of the most important aspects of ensuring that you are helping the right users at the right time, is by customizing experiences for specific groups of users. Once added, dynamic data can let you do things like customize text to include a user's first_name or display announcements to select user groups (e.g. isPaid or super_user). In this guide, we'll show you how to share dynamic data with Command AI nudges, and list out the surface area that can be customized.

Sharing dynamic data with Command AI

Dynamic data can be shared with Command AI in two main ways:

  • Each time Command AI starts, you can pass userProperties along with boot
  • At any time, you can share new dynamic data with Command AI with addMetadata

Displaying dynamic data with Command AI experiences

Don't have time to read a novel during work hours? That's okay! The quickest way to see if you can use dynamic data within Command AI is by typing {{ in any input field. Once you do, Command AI will pop up all the dynamic data that you've shared with Command AI. That's it!

Dynamic Data Autocomplete

Pro Tip! Using fallback values

Sometimes you might not have the data for every user. In that case you can use our fallback syntax with the | character: Hi {{metadata.firstName | there}}. If firstName is not found in metadata, we'll display Hi there.

Where is dynamic data supported?

Have more time? These are the different surface areas where dynamic data can be used.

  • Content: interpolating the user's name into the nudge is a great example. An often-overlooked reason to use dynamic data in content is to make it clear to the user that the nudge is relevant to them specifically. You may craft the most precise, thinly-sliced targeting rule ever. But if your user reads a generic title, they might not realize you've served up something interesting and just skip the nudge altogether.
  • Targeting: any string that you provide to a targeting rule can feature dynamic data.
  • Start page: like other URLs, a nudge's start page can be customized using dynamic data (particularly handy if your product embeds a user or organization ID in its URL schema).
  • HelpHub additional resources: same as other URLs.