Create Or Update Custom Events
The following custom event types are supported by the Intelligems Custom Events API:
clickEvent— Fires when a visitor clicks an element matching one or more CSS selectorsscrollDepth— Fires when a visitor scrolls past a configured percentage of the page (separate thresholds for mobile and desktop)pageView— Fires when a visitor views a page matchingapplyToUrlsproductPageView— Fires when a visitor views one of a specific set of product pagescollectionPageView— Fires when a visitor views one of a specific set of collection pageselementViewed— Fires when an element matching one or more CSS selectors enters the viewportjavascriptEvent— Fires from a custom JavaScript snippet
Each type has its own settings shape — see the request schema for the full set of fields per type.
Creates a new custom event, or updates an existing one by passing back its id. customEvent accepts either a single event object, or an array of event objects (up to 50) to create/update several in one request.
Custom events let you define client-side behaviors (clicks, scroll depth, page views, etc.) that can be tracked as goals or triggers on experiences.
This is a full PUT replacement — when updating an existing event, the entire event configuration is replaced with the provided data. Any optional fields omitted from the request are reset to their defaults, not preserved from the previous version.
Required Fields (inside each event object)
type- The kind of custom event (see supported types above)name- A name for the custom eventsettings- Type-specific configuration (e.g. CSS selectors forclickEvent, scroll percentages forscrollDepth)applyToUrls- Required only forpageView(at least one rule); has no effect and is ignored forproductPageView/collectionPageView
Optional Fields (inside each event object)
id(UUID) - Pass back theidfrom a previous create/update response to update that event in place instead of creating a new one. Omit to create a new event. Supplying anidthat doesn't belong to your organization creates a new event rather than adopting or overwriting it.description(string) - Description of the custom event
Important Notes
customEventmust be either a single event object or an array of up to 50 event objects — not a mix of anything else.identifieris server-generated and read-only; it is not guaranteed to stay the same across updates to the same event. Useidas the stable reference for an event, notidentifier.Returns a
403if your organization's plan does not include custom events tracking. This applies to both creating a new event and updating an existing one.
Intelligems external API access token.
OK
curl --location 'https://api.intelligems.io/v25-10-beta/custom-events' \
--header 'content-type: application/json' \
--header 'intelligems-access-token: YOUR_API_KEY' \
--data '{
"customEvent": {
"type": "clickEvent",
"name": "Add to Cart Button Click",
"settings": {
"selectors": [".add-to-cart-button"]
}
}
}'OK
{
"customEvent": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"identifier": "text",
"name": "text",
"description": "text",
"eventCountLastDay": 1,
"lastEventTs": 1,
"error": "text",
"createdAtTs": 1,
"lastUpdateTs": 1,
"archivedAtTs": 1,
"applyToUrls": [
{
"matchBy": "equals",
"value": "text",
"error": "text"
}
],
"experiencesList": [
"text"
],
"type": "text",
"settings": {}
}
}Last updated
Was this helpful?