Key-value (KV) pairs are additional data elements linked to specific actions in an In-app Messaging campaign. Each KV pair consists of a key and a value. The key serves as a descriptor, and the value is the data related to that descriptor. Using KV pairs, you can provide additional information to the app when the user interacts with the campaign to create more personalized, dynamic, and trackable user experiences.
Among the actions, KV pairs are available in:
- Navigation
- Track event
-
Custom action
To add a KV pair, perform the following steps:
- After choosing a template in the Content section, select a widget from the Preview section on the right.
- Scroll down to the Actions section and click + Action.
- Select the action from the Custom list.
- Click + New KV pair to add a KV pair to this action.
- Under Key value pairs, enter the key in the Enter name field and the value in the Data field.
Here is an explanation of some key-value pairs for each action and the reasons to use them:
Navigation
What are KV pairs in this context?
KV pairs are parameters passed with the navigation action to provide additional context or instructions to the destination screen or URL within the app.
For example:
- Key: productId, Value: 12345
- Key: source, Value: inAppCampaign
- Key: email, Value: {{UserAttribute['u_em']}}
Why should they be used?
- Personalization: KV pairs allow you to direct users to specific content based on their interests or behavior. By passing parameters like productId, you can navigate users to a particular product page. By passing email, you can prefill the next page with the user’s email.
- Dynamic content loading: The app can use the KV pairs to fetch and display content dynamically, improving user experience.
- Tracking and analytics: Including parameters like source helps in tracking the origin of the navigation, which is valuable for analytics and measuring campaign effectiveness.
Track Event
What are KV pairs in this context?
When tracking an event, KV pairs serve as event attributes, providing additional details about the event.
For example:
Event Name: ButtonClicked
Key: buttonType, Value: SubscribeButton
Key: campaignId, Value: promo_2024
Why should they be used?
- Enhanced analytics: KV pairs enrich event data, allowing for deeper insights into user behavior.
- Segmentation: Detailed event attributes enable precise user segmentation for future campaigns.
- Trigger automated actions: Specific KV pairs can trigger other automated marketing actions within MoEngage, such as sending follow-up messages.
Custom Action
What are KV pairs in this context?
In a custom action, developers can use key value pairs as custom parameters to pass to the app’s code. They can then utilize these parameters to execute specific actions.
For example:
Action Name: OpenFeature
Key: featureName, Value: AugmentedRealityViewer
Key: accessLevel, Value: premium
Why should they be used?
- Flexibility: Developers can define versatile actions using KV pairs and modify them without altering the app code.
- Personalized user experience: Developers can pass different parameters to tailor the app’s behavior to individual users or specific campaign goals.
- Dynamic updates: KV pairs enable the app to respond to in-app messages with up-to-date information, enhancing engagement.