Leanplum's user guides and developer documentation.

Leanplum Documentation

Leanplum's user guides, SDK setup, API docs, and more resources are here to help you get the most out of A/B testing, Campaigns, Messaging, and Analytics.

How to copy event parameters as user attributes

For various advanced use cases, you might need to get event parameters reflected as user attributes. Example scenarios like that are:

  • If you need to use the value of the parameter for personalization in Multi-Message Campaigns
  • If you need to segment based on this parameter in triggered Campaigns.

If you have one of those use cases, you might want to transfer the value of a particular event parameter to a user attribute, continuously. This is possible with a simple Campaign using a Webhook action:

Step 1. Create a new campaign. Select any Goal and skip the attribution window setup. Target Audience would be All Users, unless you want to limit the tracking to a particular segment of users only.

Step 2. On the Delivery tab, select triggered and configure the trigger to be the event from which you want to transfer parameters:

Step 3. Depending on your use case, you can store all values of the parameter, the last value only, or both in two separate attributes:

A. If you need to only store the last value of the parameter:
On the Actions tab, add a Webhook action. Configure it as follows:

  • The URL should point to https://www.leanplum.com/api?action=setUserAttribute
  • In the Advanced Options -> Data, add the following fields:
    • appID - your appID from App Settings
    • clientKey - your client key from App Settings
    • userAttributes - the name of the attribute you will store the parameter in, and the name of the parameter as specified in the example
    • userId - the user ID selected through the {{ selector

B. If you need to collect all values of the parameter:
On the Actions tab, add a Webhook action. Configure it as follows:

  • The URL should point to https://www.leanplum.com/api?action=setUserAttribute
  • In the Advanced Options -> Data, add the following fields:
    • appID - your appID from App Settings
    • clientKey - your client key from App Settings
    • userAttributeValueToAdd - the name of the attribute you will store the parameter in, and the name of the parameter as specified in the example
    • userId - the user ID selected through the {{ selector

Step 4. Configure the delay of your Webhook to be 0 seconds:

Step 5. Start your Campaign. From that point on, all values of the configured Event Parameter will be copied to the User Attribute.

Updated 7 months ago


How to copy event parameters as user attributes


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.