Event Collection API: Add to Cart Event

Prev Next

The Add to Cart event should be fired when a visitor adds an item to the cart from search results.

POST https://eurekaevent.api.useinsider.com/api/v1/events

Visit our Postman collection to test this request.

Request Parameters

The add to cart event supports the following properties:

Attribute NameTypeValidationDefaultDescription
referrerStringRequired, url-Source URL of the referring page
campIdInteger-999999The campId serves as a unique identifier. Refer to common fields for more details.
variationIdInteger-999999The variationId represents the unique identifier for a specific campaign variation. Refer to common fields for more details.
sourceStringoneof=
- search-popup
- search-listing
- collection-listing
- product-detail
- other
search-listingSource origin where the event triggered
integrationTypeStringRequired,
oneof=
- api
- web
-Type of integration
platformStringRequired,
oneof=
- desktop-web
- mobile-web
- ios
- android
- other
-Platform used by the user. Refer to common fields if you want to use other.
userIdString-defaultUnique identifier of the user. It is expected to provide for user-based calculations.
productList of ProductRequired-The product clicked by the user. Refer to common fields for more details.
eventTypeStringRequired,
equals=add-to-cart
-Type of event
createdAtStringRequired, formatted in RFC3339If omitted or invalid, it defaults to the current timeTime when the event is created. Refer to common fields for more details.
If your integration was implemented before the Advanced Analytics September 01, 2025, release, please note that new fields have been added to the expected product payload. Following this release, the event now retrieves currentPage and related details from product-level fields instead of top-level fields. In addition, the product object has been enriched with several new fields.
For backward compatibility, you may continue sending these values at the event level. However, it is strongly recommended to update your implementation to the new product-level structure to ensure full alignment with the latest version and to benefit from more comprehensive analytics.
You can review the full list of changes on the Common Properties page.

Sample Request

In the example below, you see a sample request along with guidance on modifying the necessary fields. This will help you seamlessly integrate and make the most of the provided configuration.

Before usage, modifying the values such as x-auth-token and x-partner-config-key is essential.
curl --location --request POST 'https://eurekaevent.api.useinsider.com/api/v1/events' \
--header 'x-auth-token: YOUR_AUTH_TOKEN' \
--header 'x-partner-config-key: YOUR_PARTNERID-YOUR_LOCALE' \
--header 'Content-Type: application/json' \
--data-raw '{
  "referrer": "https://example.com/search-results",
  "source": "product-detail",
  "userId": "user-12345",
  "platform": "ios",
  "campId": 999999,
  "variationId": 999999,
  "product": {
    "id": "product-001",
    "groupCode": "laptop-group-1",
    "query": "laptop",
    "price": 1299.99,
    "convertedPrice": 1199.99,
    "currency": "USD",
    "preferredCurrency": "EUR",
    "clickPosition": 3,
    "searchPosition": 3,
    "quantity": 2,
    "resultCount": 25,
    "itemsPerPage": 10,
    "totalPages": 3,
    "facets": [
      {
        "label": "Price",
        "field": "price_en",
        "values": ["500", "2000"]
      },
      {
        "label": "Brand",
        "field": "brand_en",
        "values": ["16GB"]
      }
    ],
    "sorting": "Relevancy",
    "currentPage": 1,
    "searchSessionId": "search-session-abc123",
    "attributionWindow": ["7", "30", "session"]
  },
  "eventType": "add-to-cart",
  "integrationType": "app",
  "createdAt": "2025-11-25T10:40:00Z"
}'