Create Your First Event
This guide will help you create and implement your first event in the Lynes Loyalty platform. By the end, you'll have a fully functional event that can track and reward user actions in your application.
Plan Your Event
First, decide what user action you want to track. For your first event, choose something simple and frequent, like:
- User login
- Feature use
- Profile update
For this tutorial, we'll create two examples: a "purchase" event with value-based rewards and a conditional event without rewards.
Step 1: Create the Event in Dashboard
- Log into your Lynes Loyalty Dashboard
- Navigate to the Events section
- Click the + Create Event button
Step 2: Set Basic Event Information
Enter a unique event ID, title, and optional description. The event ID is crucial as it's used for all communication between your system and our API. When a user performs the action (like a purchase), you'll send this event ID to our API.
Step 3: Choose Event Type
Select either a simple event (straightforward) or a conditional event (more advanced) based on your needs.
Creating a Simple Event
Rewarding Your Simple Event
Decide whether your event should award points. For our purchase example, we'll set up value-based rewards where users earn 2 points per euro spent. To prevent abuse, we'll set a maximum of 1000 points per event.
To calculate rewards properly, we need to specify which field contains the value. Set the value field name to "price" so the API knows to look for this field in the metadata when the event is triggered.
For more details about API calls and metadata, see Send an Event to Our API.
Reviewing Your Simple Event
Review all the information you've entered. The dashboard will highlight any missing data. Click "Create Event" to finish, and you're ready to send your first event to our API.
Creating a Conditional Event
Now let's create a conditional event for tracking a user's first purchase in your shop - perfect for challenges targeted at new customers.
Define Custom Event Conditions
For our new customer example, we'll define a metadata field called "new_customer" as a boolean. The condition requires this field to be true.
Additionally, we'll add a minimum price of 5€ to ensure the purchase is substantial.
The complete condition is: The purchase must come from a new customer AND have a minimum value of 5€. If both conditions are met, the event is valid and processed further.
Good to know
The dashboard provides statistics on how often your conditions are being met.
Set No Reward for This Event
Since this event is for tracking purposes only, select "No points" in the reward step and click continue.
Review Your Conditional Event
The final step shows a summary of all information. If everything looks correct, click "Create Event" to finish. Now you can start sending events to our API.
Congratulations! You've successfully created your first events in the Lynes Loyalty platform.