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_idis strongly preferred so events attribute to the right Leanplum user rather than creating throwaway anonymous users).
Configuration
| Field | Required | Description |
|---|---|---|
| App ID | Yes | Your Leanplum Application ID. |
| Production Client Key | Yes | Your 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
- In the management UI, go to Integrations and add Leanplum.
- Enter your App ID and Production Client Key.
- Attach the integration to a pipeline and choose the Retail preset (or build your own event map).
- Map your identity: the preset sends Signal
user_idas LeanplumuserIdand falls back toanonymous_idasdeviceId. - 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-urlencodedOne 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 authenticateduser_idhere. This is what ties events to a known Leanplum user and lets your messaging target them.deviceId— Signal sendsanonymous_idhere 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 event | Leanplum event |
|---|---|
page | page |
Products Searched | Search |
Product Viewed | Product Viewed |
Product Added | Add to Cart |
Checkout Started | Checkout Started |
Order Completed | Purchase |
Signed Up | Sign Up |
Logged In | Login |
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
- Send a test event from a page running Datafly.js (or replay one in the management UI Event Debugger).
- In Leanplum, open the Debugger (or Analytics > Events) and confirm the event appears for the expected user within a few minutes.
- For purchases, confirm the revenue shows under your monetization reports with the correct currency.
- Check the Signal delivery log shows a
success: trueresponse 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 theerror.messagein the Signal delivery log — common causes are a missinguserId/deviceIdor a malformedparamsvalue. paramsrejected. Theparamsfield 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_idis being collected for logged-in visitors so events carry a stableuserIdrather than only a per-sessiondeviceId. - 401 / 403. Bad
appIdorclientKey— re-copy both from App Settings > Keys & Settings.