- 02 Apr 2024
- 1 Minute to read
Event Integration
- Updated on 02 Apr 2024
- 1 Minute to read
Event Integration allows our partners to send user events to Insider. This method accepts event name, event parameters (both predefined and custom ones), and event timestamp.
For Custom Event Parameters, use a custom object in the event parameter of the object, as show in the example below. When this event is called, Insider's JavaScript (ins.js) will send that event to our database.
Each event parameter should have a different name.
For Predefined Event Parameters, refer to the Predefined Event Parameters table below.
Sample Code
The sample code here displays Predefined Event Parameters for the event event-name-1 and a Custom Event Parameter for the event event-name-2.
Insider.track('events', [{
"event_name": "event-name-1",
"timestamp": "2020-07-13T21:35:20Z",
"event_params": {
"product_id": "AGH210070",
"taxonomy": [
"Electronic",
"Phone"
],
"currency": "USD"
}
},
{
"event_name": "event-name-2",
"timestamp": "2020-07-13T21:35:20Z",
"event_params": {
"unit_price": 890,
"custom": {
"car_brand": "BMW"
}
}
}
]);
Predefined Event Parameters
Event Parameter Name | Definition | Type |
---|---|---|
product_id | Product ID | String |
name | Product Name | String |
taxonomy | Product Categories | Array |
currency | Currency | String |
unit_price | Product Price | Float |
unit_sale_price | Discounted Product Price | Float |
color | Color attribute of the product | String |
size | Size attribute of the product | String |
stock | Stock information of the product | Number |
product_image_url | Product Image URL | String |
session_id | Session ID | String |
event_group_id | Event Group ID (like transaction ID or cart ID) | String |
Validations
- Event time should be provided in a timestamp field, in RFC3339 format, on the same level with event_name and event_params. If not, the current time will be set as default.
- event_name keys should start with a letter or a number. Only lowercase, numbers, underscores and dashes are allowed. Regex is as follows: ^[a-z0-9][a-z0-9_-]*$
- event_params keys should start with a letter. Only lowercase, numbers and underscores are allowed. Regex is as follows: ^[a-z][a-z0-9_]*$