Leanplum

Leanplum (a CleverTap company) is a cross-channel customer engagement platform for mobile and web — lifecycle messaging, push, in-app, email, and behavioural analytics. Datafly Signal delivers your first-party events to Leanplum server-to-server using the Leanplum track API, so you can drive Leanplum campaigns and analytics without loading the Leanplum client SDK in the browser.

Prerequisites

  • A Leanplum account with an app created.
  • Your Leanplum App ID (App Settings > Keys & Settings).
  • Your Leanplum Production client key (App Settings > Keys & Settings). Use the Production key, not the Development key, so events land in your live environment.
  • A stable user identifier flowing through Signal (a logged-in user_id is strongly preferred so events attribute to the right Leanplum user rather than creating throwaway anonymous users).

Configuration

FieldRequiredDescription
App IDYesYour Leanplum Application ID.
Production Client KeyYesYour Leanplum Production API client key. Stored encrypted; only ever used server-side.

Both credentials are sent to Leanplum as URL query-string parameters (appId, clientKey) on every request, alongside a fixed apiVersion=1.0.6.

Configure in Signal

  1. In the management UI, go to Integrations and add Leanplum.
  2. Enter your App ID and Production Client Key.
  3. Attach the integration to a pipeline and choose the Retail preset (or build your own event map).
  4. Map your identity: the preset sends Signal user_id as Leanplum userId and falls back to anonymous_id as deviceId.
  5. Save and send a test event (see Testing).

API Endpoint

POST https://api.leanplum.com/api?action=track&appId=YOUR_APP_ID&clientKey=YOUR_CLIENT_KEY&apiVersion=1.0.6
Content-Type: application/x-www-form-urlencoded

One occurrence of an event is tracked per request. If the user identified by userId/deviceId does not exist yet, Leanplum creates one. A successful response is {"response":[{"success":true}]}. Logical failures are returned with HTTP 200 and success: false, so Signal classifies delivery by reading response.success, not the HTTP status.

Identity Signals

Leanplum identifies the subject of every event by userId and/or deviceId:

  • userId — Signal sends your authenticated user_id here. This is what ties events to a known Leanplum user and lets your messaging target them.
  • deviceId — Signal sends anonymous_id here as a fallback so pre-login activity is still recorded and can later be merged once the user identifies.

No PII is hashed for Leanplum: it expects raw userId/deviceId values, and personal attributes (email, etc.) belong in Leanplum user attributes rather than on the track call.

Event Mapping

Signal uses GA4-style snake_case event names internally and maps them to Leanplum event names. Reserved monetization events use Leanplum’s top-level value and currencyCode fields; everything else is flattened into the Leanplum params object (a flat map of string key/value pairs).

Signal eventLeanplum event
pagepage
Products SearchedSearch
Product ViewedProduct Viewed
Product AddedAdd to Cart
Checkout StartedCheckout Started
Order CompletedPurchase
Signed UpSign Up
Logged InLogin

Any event not in the map is dropped (the preset uses action: drop).

Example: a purchase

A track call from Datafly.js:

datafly.track("Order Completed", {
  order_id: "ORD-10423",
  revenue: 79.99,
  currency: "USD",
  tax: 6.40,
  shipping: 4.99,
  coupon: "SUMMER10"
});

…with an identified user, becomes this Leanplum request (form-encoded):

POST https://api.leanplum.com/api?action=track&appId=app_XXXX&clientKey=prod_XXXX&apiVersion=1.0.6

userId=u_55021
event=Purchase
value=79.99
currencyCode=USD
time=1749200400
params={"order_id":"ORD-10423","tax":"6.40","shipping":"4.99","coupon":"SUMMER10"}

Leanplum responds:

{ "response": [ { "success": true } ] }

Testing

  1. Send a test event from a page running Datafly.js (or replay one in the management UI Event Debugger).
  2. In Leanplum, open the Debugger (or Analytics > Events) and confirm the event appears for the expected user within a few minutes.
  3. For purchases, confirm the revenue shows under your monetization reports with the correct currency.
  4. Check the Signal delivery log shows a success: true response for the integration.

Troubleshooting

  • Events not appearing in Leanplum. Confirm you used the Production client key, not the Development key — Development keys land data in a separate environment.
  • Delivery marked failed despite HTTP 200. Leanplum returns logical errors as {"response":[{"success":false,"error":{"message":"..."}}]} with a 200 status. Read the error.message in the Signal delivery log — common causes are a missing userId/deviceId or a malformed params value.
  • params rejected. The params field must be a flat object of scalar key/value pairs. Nested objects or arrays are not accepted; reshape them in the blueprint before sending.
  • Everything attributes to new anonymous users. Make sure user_id is being collected for logged-in visitors so events carry a stable userId rather than only a per-session deviceId.
  • 401 / 403. Bad appId or clientKey — re-copy both from App Settings > Keys & Settings.