Custom Event

A Custom Event trigger activates when your external system sends a predefined event to Open Loyalty via API. You must first create a Custom Event Schema, which defines event names and optional attributes. Once the schema is in place, you can launch a separate campaign that responds to those custom events—fully independent from other campaign types.


🛠️ Step-by-Step Setup

1

Create Custom Event Schema

  • Navigate to Custom Events → Custom Event Schemas

  • Add optional attribute (e.g., steps) that can be used later on in the campaign rules.

  • Save the schema status to Active

For more information on how to create a custom event schema, please refer to this section of the User Guide: Custom Event Schemas

2

Add Campaign

  • Go to Campaigns or Referral Campaigns Add campaign → select Custom Event trigger.

  • Choose your event name from the schema dropdown. Attributes defined in the schema become available for use in rule conditions.

3

Set Basic Campaign Details

  • Name, Description, Translations

  • Start/End Date, Display Order, Visibility (Everyone / Segment / Tier)

  • Campaign Status – The campaign will start only if it is active

4

Add Rules

  • Add Conditions using event.body.<attribute> (e.g., filtering where event.body.steps ≥ 5000)

  • Effect: e.g., "Add units: 1 × amount of steps", "Add 100 fixed points", "Issue coupon".

5

Set Limits & Budget

  • Per-member frequency (e.g., once per month)

  • Campaign-level spending caps (total units)

6

Summary

  • Review the campaign configuration and amend if needed

  • Click on Add Campaign

7

Test Campaign - Send Event via API

Use POST /api/{storeCode}/customEvent with payload:

{
  "event": {
    "type":"app_login",
    "eventDate":"2025-07-15T11:26:46.299Z",
    "customerData": { "email":"[email protected]" },
    "body": { "key":"value" }
  }
}

Successful sends return status 200.


⚙️ Why Use Custom Event Campaigns

  • Flexibility: Trigger campaigns on any behavior tracked externally—app usage, fitness milestones, third‑party integrations, and more.

  • Precision Targeting: Use schema attributes in conditions to segment and personalize campaigns.

  • De-coupled Execution: Events and campaigns are independent—no side effects on other systems.


✅ Best Practices

  • Define Schemas Thoughtfully: Include only necessary attributes needed for campaign logic.

  • Test End-to-End: Send test events via API and verify they appear under Custom Events in the admin UI.

  • Limit Rewards: Use per-member and campaign-wide limits to prevent over-issuing.

  • Track Engagement: Monitor event-driven campaign metrics to understand response rates.

Last updated

Was this helpful?