younifyd
Menu

Track Custom Event

Track Custom Event

POST/v1/events

Use it in a workflow

  1. Add a step and choose the Voucherify connector.
  2. Pick the Track Custom Event action (under Events).
  3. Fill in the fields below, then reference the result from later steps as {{trackCustomEvent.response.data}}.

Request

Request body

Enter the body as JSON in the step's Body field.

eventstring

Event name. This is the same name that you used to define a custom event in the **Dashboard** > **Project Settings** > **Event Schema**.

customeranyrequired

Customer's information.

referralobject

If a **conversion event** for a referral program is set to a custom event, then you need to send the referral code in the payload to make a record of the conversion event.

codestring

A code through which a new visitor has been referred to a service.

referrer_idstring

Unique ID of the referring person - it is optional and not required if the referral **code** is provided.

loyaltyobject

If an earning rule in a loyalty program is based on a custom event. This objects let's you specify the loyalty card to which the custom event should be attributed to.

codestring

Code of the loyalty card to receive points based on the calculation method defined in the related earning rule. An earning rule is triggered for the loyalty card when the event passed in the `event` parameter of the request payload gets sent along with this loyalty card code.

metadataobject

The metadata object stores all custom attributes assigned to the event. A set of key/value pairs that you can attach to an event object. It can be useful for storing additional information about the event in a structured format. Event metadata schema is defined in the **Dashboard** > **Project Settings** > **Event Schema** > **Edit particular event** > **Metadata property definition**.

json
{
  "customer": null,
  "event": "string",
  "referral": {
    "code": "string",
    "referrer_id": "cust_Vzck5i8U3OhcEUFY6MKhN9Rv"
  },
  "loyalty": {
    "code": "L-CARD-BUHuH6g"
  },
  "metadata": {}
}

Response

Returns 200 with an object. Read it in later steps with {{trackCustomEvent.response.data.<field>}}.

objectstring

The object represented is an `event`.

One ofeventDefault "event"

typestring

The event name.

customerany

A simple customer object

referralobject

A `null` referral object.

loyaltyobject

A `null` loyalty object.

metadataobject
json
{
  "customer": null,
  "object": "event",
  "type": "string",
  "referral": {},
  "loyalty": {},
  "metadata": {}
}

Need more? See the Voucherify guide for connection setup and behaviour shared by every action.

Track Custom Event — Voucherify — Documentation