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.

Testing a personalized message

The Leanplum templating language {{, based on Jinja, gives you powerful options to customize the text of your messages. However, the flexibility of the syntax means it's also possible to have typos and other easy-to-miss mistakes that can lead to errors in your message. So, it's important to test your Jinja.

Here are two quick ways to test your personalized messages.

Test using an in-app message

The easiest way to test your message is using a Leanplum in-app message because they don't require APNS / GCM to perform the message delivery. Even if you're planning to use your message inside a push notification, we recommend you create a temporary in-app message for more rapid iteration as you write your personalized message with Jinja.

  1. Make sure you have registered your test device.
  2. Run your app on your test device.
  3. In the Message Composer, create an in-app message and choose any template (such as "Alert") and then enter your Jinja message into the Message field.
  4. Click Preview. The message should appear immediately on your test device.


If your Jinja message references user attributes, the preview will show the user attributes corresponding to your test device.

Test using the Leanplum API

What if you don't have a Development build? Or if you want to evaluate what the message would say for another user (such as a user in another country/language, or a user with a different set of user attributes)?

A quick option to test the message is with the getVars method of our API.

  1. Follow the steps above to put your Jinja message into a new in-app message. For this example, we'll add the "firstName" and "destinationCity" user attributes.
  1. Add a Target for a specific User ID, the user that you are planning to test with.
  1. Remove the "Display when" trigger, as additional insurance that this message will never display to a real end user.
  1. Click the Start button to start the message.
  2. Get your App ID and Production Key from your Keys & Settings in the dashboard.
  3. In your browser or Postman, construct and send the following API call:
  1. The API response should contain a JSON object with a nested messages object that includes all messages for this user, including our test message. In this object, under message.text, you should see the rendered personalized content based on this user's data.
"5185286634471424": {
          "vars": {
            "Layout": {
              "Height": 250,
              "Width": 300
            "Accept action": {
              "__name__": ""
            "Message": {
              "Text": "Hey John! Your next trip is to San Diego.",
              "Color": 4278190080
            "__name__": "Center Popup",
            "Accept button": {
              "Text": "OK",
              "Text color": 4278221311,
              "Background color": 4294967295
            "Title": {
              "Text": "Test message",
              "Color": 4278190080
            "Background color": 4294967295,
            "Background image": ""
          "countdown": 86400,
          "whenLimits": {
            "verb": "AND",
            "children": [
                "verb": "limitUser",
                "noun": 1,
                "subject": "times",
                "objects": []
          "priority": 1000,
          "action": "Center Popup"

Updated 2 years ago

Testing a personalized message

Suggested Edits are limited on API Reference Pages

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