Using an AI coding agent? Let it instrument your events and revenue correctly (taxonomy, dedupe, refunds, and these server-side APIs):See Linkrunner Agent Skills.
Events are stored for all users, including organic ones. Events from users with no matching click are stored without campaign attribution. Each request must identify the user with
user_id or install_instance_id. You can verify your events are being captured on the Events page. For capturing revenue, it is recommended to use the capture-payment API instead of capture-event.Base URL
Authentication
Generate your server key from https://dashboard.linkrunner.io/settings?s=data-apis In the request header add the below attribute:Capture Event
Request Body
Responses
- 200 Event captured successfully
- 400 Missing required parameters, or neither
user_idnorinstall_instance_idwas sent - 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: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
Meta Ecommerce Events
If you are tracking Ecommerce events (likeadd_to_cart or view_content) to sync with Meta Catalog Sales, you must first map your custom event with the standard commerce event in the Linkrunner Dashboard before sending the event.
Note: Any event you want to send for an add to cart action should be mapped with AddToCart for Commerce Event Manager. For example, map add_to_cart with AddToCart.
Similarly, any event you want to send for viewing a product should be mapped with ViewContent. For example, map item_viewed with ViewContent or view_content with ViewContent.
While you can include any custom attributes in the event_data object, Meta requires specific fields for ecommerce events in order to correctly attribute catalog sales and optimize campaigns.
Example Ecommerce Payload
Here is an example of the exactevent_data structure you need to send for Meta Commerce Manager:
For comprehensive details on each field requirement, refer to our Meta Commerce Manager documentation.