PostUserEvent

Post an individual user event. Server host may vary by platform. Moloco's account manager will provide accurate host information.

Path Params
string
required

Platform for the user event.

Body Params
string
length ≤ 128

Recommended. Unique ID generated by the client that could be used as an identifier. The length should not exceed 128 characters.

string
enum
required
Defaults to UNKNOWN_EVENT_TYPE

Supported EventTypes.

string
required

Unix timestamp in milliseconds that the event happened at. (e.g., 1617870506121)

string
enum
required
Defaults to UNKNOWN_CHANNEL_TYPE

ChannelType enumerates available channel types. Simply using APP and SITE is fine, but you can also further distinguish DESKTOP_SITE and MOBILE_SITE for web users.

  • APP: Mobile App (iOS or Android)
  • SITE: Site (e.g. Website)
  • DESKTOP_SITE: Desktop Site (e.g. Desktop Website)
  • MOBILE_SITE: Mobile Site (e.g. Mobile Website)
Allowed:
string

Set domain to a value that can identify the domain portion of your website's URL. We recommend you keep the same value across your website and application if they share your backend.

string
length ≤ 128

User identifier used by the platform. This should typically be the sign-in ID used within the platform, and is highly recommended to be hashed prior to being sent to Moloco. Please provide this value whenever available to achieve optimal performance. If the value is unknown for any reason, please leave empty and do not fill in a default or random value.

device
object
items
array of objects

Items information related to the event. Required for ADD_TO_CART, ADD_TO_WISHLIST, ITEM_PAGE_VIEW and PURCHASE event types.

items
revenue
object

A monetary amount in a specific currency. For example, {currency: "USD", amount: 12.34} means $12.34. Price of the single item.

string

Query string for the search. Required for SEARCH event.

string
length ≤ 128

Deprecated. Please use custom_id as alternative. Identifier for tracking users regardless of sign-in status. The length should not exceed 128 characters.

string
length ≤ 128

Alternative ID to track users regardless of sign-in status or device. This ID should be provided as a third option following the user_id and device.persistent_id, and is highly recommended to be hashed prior to being sent to Moloco. This ID must be provided if both the user_id and device.persistent_id fields are left empty. Please do not fill in a default value, and instead randomize it if you must, but we recommend you send some ID that can be used to track users even if for a short time span. Please reach out to Moloco if you have further questions about this ID.

string

Page ID should be a uniquely assigned value for each page in the app or web site. It is a mandatory field if the Event type is PAGE_VIEW. Otherwise, it's not required to have a value for the page_id parameter. If the Event type is PAGE_VIEW, provide a string that can identify a context of the event, such as "electronics", "categories/12312", "azd911d" or "/classes/foo/lectures/bar." Any value will be acceptable if it helps identify unique pages.

string

Similar to referer in HTTP, this value indicates from which page the user came to the current page.

shipping_charge
object

A monetary amount in a specific currency. For example, {currency: "USD", amount: 12.34} means $12.34. Price of the single item.

string

Track ID for the event. Track ID is generated by a call to the Decision API. Fill in this field accordingly if the user event is to be associated with a Decision API response.

Responses

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json