Conversion goals overviewMenu
On this page

Conversion goals

A conversion goal says what counts as a result for a campaign or a journey: an event, such as an order, done within a window after one of its messages, with an event property summed as revenue. A journey's and a campaign's metrics report their goals; a journey can also end each enrollment when its goal is reached. Goals need a paid plan.

Endpoints

EndpointRequest
List the conversion goals of a campaign or journeyGET /v1/conversion-goals
Create a conversion goalPOST /v1/conversion-goals
Change a conversion goalPATCH /v1/conversion-goals/{id}
Delete a conversion goalDELETE /v1/conversion-goals/{id}
Report a conversion goal's resultsGET /v1/conversion-goals/{id}/metrics

The ConversionGoal object

ConversionGoal example
{
  "id": "018f2a4e-6b1c-7d3e-9f40-37386ae05a6b",
  "campaignId": "018f2a4e-6b1c-7d3e-9f40-3478765e5a6b",
  "journeyId": "018f2a4e-6b1c-7d3e-9f40-7cf2bf7e5a6b",
  "eventName": "eventName_example",
  "where": [
    {
      "property": "property_example",
      "operator": "equals",
      "value": "value_example"
    }
  ],
  "occurrence": "first",
  "attributionWindow": {
    "value": 1,
    "unit": "seconds"
  },
  "windowChangedAt": "2030-03-14T09:30:00Z",
  "valueProperty": "valueProperty_example",
  "currency": "currency_example",
  "countedFrom": "2030-03-14T09:30:00Z",
  "createdAt": "2030-03-14T09:30:00Z"
}
idstringrequired

uuid

campaignIdstring | nullrequired

The campaign it measures.

uuid

journeyIdstring | nullrequired

The journey it measures.

uuid

eventNamestringrequired

The event that counts as a conversion.

whereobject[] | nullrequired

Property conditions the event must meet; null counts every one.

at least 1 item · at most 5 items

3 child attributes
propertystringrequired

The event property key.

1–64 characters

operatorstringrequired

notEquals also matches an event without the property. equals and notEquals compare the property as text, ignoring case and accents.

one of equals, notEquals, gt, gte, lt, lte

valuestringrequired

What to compare with, as text ("pro", "true"); a number ("50") for gt, gte, lt and lte.

up to 255 characters

occurrencestring | nullrequired

first: only the contact's first event of this name; repeat: any after it; null: every one.

one of first, repeat

attributionWindowDurationrequired

How long after a message the event still counts, in days.

2 child attributes
valueintegerrequired

min > 0

unitstringrequired

one of seconds, minutes, hours, days

windowChangedAtstring | nullrequired

When the attribution window was last changed; null if never. A change applies to events processed after it: conversions counted before keep the window they were counted under.

date-time

valuePropertystring | nullrequired

The event property summed as revenue; null counts no value.

currencystring | nullrequired

The revenue's currency, if named.

countedFromstringrequired

The earliest events the goal can count: when it was created, the start of the event history then retained. Events from then on are matched to the sends before them, those tracked before the goal existed included; older ones are gone.

date-time

createdAtstringrequired

date-time