Base URL
Authentication
Generate your server key from https://www.linkrunner.io/settings?s=data-apis In the request header add the below attribute:Capture Event
Request Body
Parameter | Type | Description |
---|---|---|
event_name | string | Required. Name of the event to track |
event_data | object | Optional. Additional data associated with the event |
user_id | string | Required. User identifier to associate with the event |
Responses
- 201 Event captured successfully
- 400 Missing required parameters
- 401 Invalid server key
Sample Response
Upon successful event capture, the API returns:Common Event Names
Here are some common event names you might want to track:Event Name | Description |
---|---|
purchase_initiated | User starts a purchase |
purchase_completed | User completes a purchase |
item_viewed | User views an item/product |
cart_added | User adds item to cart |
checkout_started | User starts checkout |
search_performed | User performs a search |
content_viewed | User views content |
level_completed | User completes a level (for games) |
achievement_unlocked | User unlocks an achievement |
user_referred | User refers someone |
Revenue Sharing with Ad Networks
To enable revenue sharing with ad networks like Google Ads and Meta, include anamount
parameter as a number in your custom event data. This allows the ad networks to optimize campaigns based on the revenue value of conversions:
For revenue sharing with ad networks to work properly, ensure the
amount
parameter is passed as a number, not as a
string.Best Practices
- Consistent naming: Use consistent naming conventions for your events (snake_case is recommended)
- Structured data: Include structured data with each event to get more insights
- Meaningful events: Track events that provide valuable insights into user behavior
- Data efficiency: Don’t include sensitive or unnecessary data in event payloads
Example
Tracking a Purchase Event
Error Handling
The API will return appropriate HTTP status codes along with error messages when issues occur:- 400 Bad Request: Check your request parameters
- 401 Unauthorized: Verify your server key
- 429 Too Many Requests: You’ve exceeded the rate limit, please try again later
- 500 Internal Server Error: Contact support if this persists