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
| Endpoint | Request |
|---|---|
| List the conversion goals of a campaign or journey | GET /v1/conversion-goals |
| Create a conversion goal | POST /v1/conversion-goals |
| Change a conversion goal | PATCH /v1/conversion-goals/{id} |
| Delete a conversion goal | DELETE /v1/conversion-goals/{id} |
| Report a conversion goal's results | GET /v1/conversion-goals/{id}/metrics |
The ConversionGoal object
{
"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"
}idstringrequireduuid
campaignIdstring | nullrequiredThe campaign it measures.
uuid
journeyIdstring | nullrequiredThe journey it measures.
uuid
eventNamestringrequiredThe event that counts as a conversion.
whereobject[] | nullrequiredProperty conditions the event must meet;
nullcounts every one.at least 1 item · at most 5 items
3 child attributes
propertystringrequiredThe event property key.
1–64 characters
operatorstringrequirednotEqualsalso matches an event without the property.equalsandnotEqualscompare the property as text, ignoring case and accents.one of
equals,notEquals,gt,gte,lt,ltevaluestringrequiredWhat to compare with, as text (
"pro","true"); a number ("50") forgt,gte,ltandlte.up to 255 characters
occurrencestring | nullrequiredfirst: only the contact's first event of this name;repeat: any after it;null: every one.one of
first,repeatattributionWindowDurationrequiredHow long after a message the event still counts, in days.
2 child attributes
valueintegerrequiredmin > 0
unitstringrequiredone of
seconds,minutes,hours,days
windowChangedAtstring | nullrequiredWhen the attribution window was last changed;
nullif never. A change applies to events processed after it: conversions counted before keep the window they were counted under.date-time
valuePropertystring | nullrequiredThe event property summed as revenue;
nullcounts no value.currencystring | nullrequiredThe revenue's currency, if named.
countedFromstringrequiredThe 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
createdAtstringrequireddate-time