Event Integration
  • 02 Apr 2024
  • 1 Minute to read

    Event Integration


      Article Summary

      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.

      your title goes here
      Most standard events (cart page view, purchase) are processed using the Insider Object Integration method. You can use the Event Integration method for most other user events.

      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.

      Your title goes here
      You should trigger this function after the Insider Tag (ins.js) loads for ins.js to reach the data.
      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 NameDefinitionType
      product_idProduct IDString
      nameProduct NameString
      taxonomyProduct CategoriesArray
      currencyCurrencyString
      unit_priceProduct PriceFloat
      unit_sale_priceDiscounted Product PriceFloat
      colorColor attribute of the productString
      sizeSize attribute of the productString
      stockStock information of the productNumber
      product_image_urlProduct Image URLString
      session_idSession IDString
      event_group_idEvent 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_]*$

      Was this article helpful?


      ESC

      Eddy, a super-smart generative AI, opening up ways to have tailored queries and responses