Webmarketer API (1.0.0)
Webmarketer is a marketing tool allowing to collect interactions, events and attribute them. This API allows you to interact with your data.
Webmarketer API uses the date-time
format as specified in RFC3339. RFC3339 is a profile of the ISO 8601 standard for date and time formats which is widely used in Internet protocols and standards.
The API uses this format to represent an instant with any timezone offset.
Note : If a timezone offset is not provided, the API will consider the date-time as UTC.
For example, 2022-04-01Z05:00:00
, 2022-04-01T06:00:00+01:00
and 2022-04-01T03:00:00-02:00
represent the same instant in UTC, UTC +1 and UTC -2 respectively.
Create an event asynchronously
This endpoint allows you to send an event to Webmarketer.
An event represent an user action on your website or application that you want to track with Webmarketer.
Ensure you have properly configured your event types in Webmarketer before sending events and the event data you are sending matches your declared event-type schema.
With this enpoint, event ingestion is asynchronous, so you will receive a 200 response even if the event is not yet processed or invalid. You can consult the trashed events in the Webmarketer interface.
Request Body schema: application/jsonrequired
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ Your Webmarketer project id |
eventType required | string Event Type reference of the event to send |
eventDate | string <date-time> Date of the event, see Date Specification section for more information. |
trackerId | string Tracker ID of the user who made the event (if not provided, Webmarketer won't be able to attach the event to user interactions) |
nonce required | string A unique identifier used to deduplicate event in case of multiple sends |
data required | object Data of the event (must match the event type schema) |
Responses
Request samples
- Payload
{- "projectId": "string",
- "eventType": "purchase",
- "eventDate": "1955-11-12T22:00:00Z",
- "trackerId": "23jkfs1ufeuih1fh",
- "nonce": 123456789,
- "data": {
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "amount": 100,
- "currency": "EUR"
}
}
Response samples
- 200
- 400
- 500
"da717cf8-cd33-4a6d-a052-68e2096f06b9"
Create an event synchronously
This endpoint allows you to send an event to Webmarketer.
An event represent an user action on your website or application that you want to track with Webmarketer. Ensure you have properly configured your event types in Webmarketer before sending events and the event data you are sending matches your declared event-type schema.
Event ingestion is synchronous on this endpoint, so you will receive a 200 response when the event is fully processed.
Request Body schema: application/jsonrequired
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ Your Webmarketer project id |
eventType required | string Event Type reference of the event to send |
eventDate | string <date-time> Date of the event, see Date Specification section for more information. |
trackerId | string Tracker ID of the user who made the event (if not provided, Webmarketer won't be able to attach the event to user interactions) |
nonce required | string A unique identifier used to deduplicate event in case of multiple sends |
data required | object Data of the event (must match the event type schema) |
Responses
Request samples
- Payload
{- "projectId": "string",
- "eventType": "purchase",
- "eventDate": "1955-11-12T22:00:00Z",
- "trackerId": "23jkfs1ufeuih1fh",
- "nonce": 123456789,
- "data": {
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "amount": 100,
- "currency": "EUR"
}
}
Response samples
- 200
- 400
- 409
- 500
"da717cf8-cd33-4a6d-a052-68e2096f06b9"
Gets a Raw Event by ID
This endpoint allows you to retrieve a raw event by its id (Event ids are generated by Webmarketer and are globally unique)
The raw event is the event as it was sent to the Webmarketer API, without any transformation, this endpoint does not allow to get the data computed by Webmarketer.
If your want to get the computed data, please use the /projects/{projectId}/users/{id}/events
or /projects/{projectId}/events/{id}
endpoint.
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string <uuid> (events-event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "e5be5b04-0721-4a6e-87eb-b880f81a12d2",
- "projectId": "your-project",
- "nonce": "e5be5b04-0721-4a6e-87eb-b880f81a12d2",
- "eventType": "complaint",
- "trackerId": "ru1cc7QHeklGu2_3MOzLkLncu3KJAQ",
- "createdAt": "2004-09-22 14:15:00Z",
- "data": {
- "message": "Our plane got lost...",
- "flight": "Oceanic 815",
- "from": "SYD - Sydney",
- "to": "LAX - Los Angeles",
- "seat": "24D",
- "first_name": "John",
- "last_name": "Locke",
- "email": "john.locke@webmarketer.io",
- "location": {
- "zipcode": "33000",
- "country": "France"
}
}
}
Get Trashed events
This endpoint allows you to fetch the trashed events.
When an event cannot be processed by Webmarketer (when a mandatory field is missing, or when some fields values are invalid)
the event will be stored in the "trash collection", allowing you to investigate and debug.
⚠️ Note: the field
key in the errors array will be removed in a near future, the field
will be changed to a string.
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
query Parameters
since | string <date-time> Example: since=2023-08-19T22:00:00.000Z Allow you to filter by a lower date limit (optional) |
until | string <date-time> Example: until=2023-08-21T21:59:59.999Z Allow you to filter by a upper date limit (optional) |
offset | integer Example: offset=50 Items to skip (pagination) |
limit | integer Example: limit=10 Max returned items (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
- 429
{- "count": 2,
- "total": 36,
- "data": [
- {
- "_id": "4b51a5d9-4cd0-4c2b-8925-cf7c8ebc973c",
- "projectId": "my-project",
- "errors": [
- {
- "type": "invalid-field",
- "field": {
- "discriminant": true,
- "entity": "user",
- "storageKey": "phone",
- "isPii": true,
- "isMostProbableLocation": false,
- "type": "phone",
- "ingestionKey": "phone",
- "optional": false
}, - "value": "0613"
}
], - "eventTypeId": "64c27df69d741cd3db897b93",
- "eventTypeRef": "call-me-back",
- "processingDate": "2023-08-21T19:22:19.600Z",
- "rawEventDate": "2023-08-21T19:22:17.095Z"
}, - {
- "_id": "99232bfd-af33-4373-af7b-6dffd2938e0b",
- "projectId": "my-project",
- "errors": [
- {
- "type": "invalid-field",
- "field": {
- "discriminant": false,
- "entity": "user",
- "storageKey": "location",
- "isPii": false,
- "isMostProbableLocation": true,
- "type": "location",
- "ingestionKey": "location",
- "optional": false
}, - "value": {
- "zipcode": "wd",
- "country": "wd"
}
}
], - "eventTypeId": "64c27df69d741cd3db897b93",
- "eventTypeRef": "call-me-back",
- "processingDate": "2023-08-20T18:47:15.520Z",
- "rawEventDate": "2023-08-20T18:47:13.159Z"
}
]
}
Event insights (without attribution)
This endpoint allows you to generate the insight about event.
⚠️ Note that this endpoint get data from the event without using the attribution, if you want insights about attributed data, please refer to TODO.
This endpoint allows you to retrieve multiple metrics and aggregate them by a date dimension and by event-type
if needed.
The metrics can be :
- Your statistics technical keys (ie:
turnover
if you used the e-commerce project bootstrap) - Your states technical keys (ie:
rdv
orconverted
if you declared theses offline states) event-count
this one is a built-in metric that count the number of events
The classic date dimension can be :
- day
- week
- month
- quarter
- semester
- year
If needed you can use a non-linear date dimension, allowing you to identify seasonality in your data.
- dayOfWeek
- dayOfMonth
- dayOfYear
- weekOfYear
- monthOfYear
- quarterOfYear
- semesterOfYear
You can also use the event-type
breakdown, this option will generate an output entry for each couple date interval/event-type.
This endpoint is designed to generate graphs so it is not paginated.
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
since required | string <date-time> Allow you to set a lower date limit (optional) |
until required | string <date-time> Allow you to set an upper date limit (optional) |
metrics required | Array of strings List of the metrics you want to retrieve, the keys must be the technical keys of state, statistics or ⚠️ Note that invalid keys will not generate an error, the returned value will always be 0. |
groupBy required | string The desired breakdown ( |
interval required | string The desired interval can be: |
filter | any Only pertinent for event-type breakdown, this parameters restrict the retrieved breakdowns. |
Responses
Request samples
- Payload
{- "since": "2023-08-01T22:00:00.000Z",
- "until": "2023-08-19T22:00:00.000Z",
- "metrics": [
- "event-count",
- "turnover",
- "qualified",
- "rdv",
- "converted"
], - "groupBy": "`project` or `event-type`",
- "interval": "`day`, `week`, `month`, `monthOfYear`, etc.",
- "filter": null
}
Response samples
- 200
- 400
- 401
- 403
- 429
Project breakdown with day interval
[- {
- "identifier": "my-project",
- "interval": "2023-08-21",
- "values": {
- "event-count": 10,
- "turnover": 6532
}
}, - {
- "identifier": "my-project",
- "interval": "2023-08-22",
- "values": {
- "event-count": 3,
- "turnover": 1275
}
}
]
Update an event state
This endpoint allows you to update a state of an event.
After being generated, an event state can evolve. It is common to see a call-me-back
event pass to a qualified
state after having been qualified by your sales team, then set the converted
state when the user order.
If in this example, the event seems to only have one state at a time, this is not how Webmarketer models your events.
For the example above, Webmarketer will store :
qualified
on 2023-08-10T14:30:00Zconverted
on 2023-08-18T17:30:00Z
Each event state is described with a date.
In the future, this modeling will allow you to analyze the transients between theses states
(e.g. how long does it take to get a lead from qualified
to converted
when it comes from Facebook).
Troubleshooting
If you encounter 404 response telling that "No storageKey matching field in this eventType" :
- You may have a typo in the state name
- The state did not exists at the time the event you trying to update where created
In the second case, if you need to update state of past events for which a state did not exists, our team can manually add them to allow historical updates : please contact us.
Even if we love giving you the autonomy to manage your data, we prefer to be cautious about this kind of update, backdating the states can cause inconsistencies (e.g. when renaming states over time), our experts will ensure that "backdating" will not cause side effects)
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string <uuid> (events-event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
storageKey required | string Example: converted The storage key of the state you want to update |
Request Body schema: application/jsonrequired
value required | number The value of the state (0 or 1) |
date | string <date-time> The date when the state changed, leave it blank if not relevant |
Responses
Request samples
- Payload
{- "value": 1,
- "date": "2023-05-04T12:00:00.000Z"
}
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}
Update an event statistic
This endpoint allows you to update a statistic of an event.
Event statistic allow you to inform Webmarketer about your event metrics (like turnover, or quoted amount).
A classical situation is when an event leads to a sale of 4 000€.
By updating the "turnover" stat, you allow Webmarketer to affect this amount to the campaigns that led to this event (according to your attribution models).
E.g. : with a linear model and two interactions : 50% google (2000€), 50% facebook (2000€)
As for event state, a statistic can also be set to a specific date.
In the future, this modeling will allow you to analyze the transients between theses states
(e.g. how long does it take to get a lead from qualified
to converted
when it comes from Facebook).
Troubleshooting
If you encounter 404 response telling that "No storageKey matching field in this eventType" :
- You may have a typo in the state name
- The state did not exists at the time the event you trying to update where created
In the second case, if you need to update state of past events for which a state did not exists, our team can manually add them to allow historical updates : please contact us.
Even if we love giving you the autonomy to manage your data, we prefer to be cautious about this kind of update, backdating the states can cause inconsistencies (e.g. when renaming states over time), our experts will ensure that "backdating" will not cause side effects)
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string <uuid> (events-event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
storageKey required | string Example: turnover The storage key of the statistic you want to update |
Request Body schema: application/jsonrequired
value required | number The value of the statistic |
date | string <date-time> The date you want the statistic changed, leave it blank if not relevant |
Responses
Request samples
- Payload
{- "value": 4000,
- "date": "2023-05-04T12:00:00.000Z"
}
Response samples
- 401
- 403
- 404
- 429
{- "statusCode": 401,
- "message": "Unauthorized"
}
Gets an Event by ID
This endpoint allows you to retrieve an event by its id (Event ids are generated by Webmarketer and are globally unique)
The event is the computed event from the raw event which was sent to the Webmarketer API (linked user, passed data parsed).
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string <uuid> (events-event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "projectId": "demo-ecommerce",
- "userId": "668fdaae3a8d910335ec56b1",
- "eventDate": "2024-04-16T20:37:02.000Z",
- "eventType": "order",
- "attributable": true,
- "expirationPolicy": null,
- "event": { },
- "user": {
- "firstname": {
- "raw": "Felicita",
- "current": "Felicita",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "lastname": {
- "raw": "Tillman",
- "current": "Tillman",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "email": {
- "raw": "lenora.greenfelder@stoltenberg.com",
- "current": "lenora.greenfelder@stoltenberg.com",
- "type": "email",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "phone": {
- "raw": "+13072805881",
- "current": "+1 307 280 5881",
- "type": "phone",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "address": {
- "raw": {
- "country": "France",
- "zipcode": "10928"
}, - "type": "location",
- "current": {
- "formattedAddress": "France",
- "location": {
- "type": "Point",
- "coordinates": [
- 2.213749,
- 46.227638
]
}, - "extra": {
- "googlePlaceId": "ChIJMVd4MymgVA0R99lHx5Y__Ws",
- "confidence": 0.5,
- "premise": null,
- "subpremise": null,
- "neighborhood": "France",
- "establishment": null
}, - "administrativeLevels": { },
- "city": null,
- "zipcode": null,
- "streetName": null,
- "streetNumber": null,
- "country": "France",
- "countryCode": "FR"
}, - "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "external-id": {
- "raw": "02c5fa45-be95-304b-90ed-2fb213594279",
- "current": "02c5fa45-be95-304b-90ed-2fb213594279",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}
}, - "metrics": [
- {
- "_id": "668fdff63a8d910335ec5ae1",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "turnover",
- "type": "statistic",
- "data": {
- "type": "currency",
- "date": "2024-04-16T20:37:02.000Z",
- "raw": {
- "amount": 70.23,
- "currency": "EUR"
}, - "current": {
- "currency": "EUR",
- "amount": 70.23
}, - "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae2",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "product-count",
- "type": "statistic",
- "data": {
- "raw": 3,
- "current": 3,
- "type": "number",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae3",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "paid",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-16T20:37:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.802Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae4",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "refund",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-19T20:50:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:44.487Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae5",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "event-count",
- "type": "statistic",
- "data": {
- "current": 1,
- "date": "2024-04-16T20:37:02.000Z",
- "raw": 1,
- "type": "number",
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae6",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-paid",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-16T20:37:17.000Z",
- "raw": 15,
- "current": 15,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:55.676Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae7",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-refund",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-19T20:50:17.000Z",
- "raw": 259995,
- "current": 259995,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:45.962Z",
- "deletedAt": null
}
], - "createdAt": "2024-07-11T13:36:53.922Z",
- "updatedAt": "2024-07-11T13:36:53.922Z"
}
Gets all metrics of a user
This endpoint allows you to retrieve all metric by their user id (Event ids are generated by Webmarketer and are globally unique)
The raw event is the event as it was sent to the Webmarketer API, without any transformation, this endpoint does not allow to get the data computed by Webmarketer. The event is the computed data created from the raw event sent to the Webmarrketer API (linked user, passed data parsed)
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string <uuid> (events-event_id) Example: bbee1c25-8718-4c95-b720-b00567113233 Id of the event |
query Parameters
type | string Enum: "state" "statistic" The type of metrics wanted (all if not set). |
since | string <date-time> The minimum date for metric metricDate (data.date) (inclusive). |
until | string <date-time> The maximum date for metric metricDate (data.date) (inclusive). |
offset | number The number of skipped items from the original query. |
limit | number The maximum number of item retrieved. |
sort | string Enum: "createdAt" "updatedAt" "metricDate" The date by which will be sorted retrieved items. |
order | string Enum: "ASC" "DESC" The order of the sorting. |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "projectId": "demo-ecommerce",
- "userId": "668fdaae3a8d910335ec56b1",
- "eventDate": "2024-04-16T20:37:02.000Z",
- "eventType": "order",
- "attributable": true,
- "expirationPolicy": null,
- "event": { },
- "user": {
- "firstname": {
- "raw": "Felicita",
- "current": "Felicita",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "lastname": {
- "raw": "Tillman",
- "current": "Tillman",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "email": {
- "raw": "lenora.greenfelder@stoltenberg.com",
- "current": "lenora.greenfelder@stoltenberg.com",
- "type": "email",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "phone": {
- "raw": "+13072805881",
- "current": "+1 307 280 5881",
- "type": "phone",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "address": {
- "raw": {
- "country": "France",
- "zipcode": "10928"
}, - "type": "location",
- "current": {
- "formattedAddress": "France",
- "location": {
- "type": "Point",
- "coordinates": [
- 2.213749,
- 46.227638
]
}, - "extra": {
- "googlePlaceId": "ChIJMVd4MymgVA0R99lHx5Y__Ws",
- "confidence": 0.5,
- "premise": null,
- "subpremise": null,
- "neighborhood": "France",
- "establishment": null
}, - "administrativeLevels": { },
- "city": null,
- "zipcode": null,
- "streetName": null,
- "streetNumber": null,
- "country": "France",
- "countryCode": "FR"
}, - "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "external-id": {
- "raw": "02c5fa45-be95-304b-90ed-2fb213594279",
- "current": "02c5fa45-be95-304b-90ed-2fb213594279",
- "type": "string",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}
}, - "metrics": [
- {
- "_id": "668fdff63a8d910335ec5ae1",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "turnover",
- "type": "statistic",
- "data": {
- "type": "currency",
- "date": "2024-04-16T20:37:02.000Z",
- "raw": {
- "amount": 70.23,
- "currency": "EUR"
}, - "current": {
- "currency": "EUR",
- "amount": 70.23
}, - "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae2",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "product-count",
- "type": "statistic",
- "data": {
- "raw": 3,
- "current": 3,
- "type": "number",
- "date": "2024-04-16T20:37:02.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae3",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "paid",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-16T20:37:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.802Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae4",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "refund",
- "type": "state",
- "data": {
- "raw": 1,
- "current": 1,
- "type": "state",
- "date": "2024-04-19T20:50:17.000Z",
- "anonymized": false,
- "invalid": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:44.487Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae5",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "event-count",
- "type": "statistic",
- "data": {
- "current": 1,
- "date": "2024-04-16T20:37:02.000Z",
- "raw": 1,
- "type": "number",
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:54.075Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae6",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-paid",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-16T20:37:17.000Z",
- "raw": 15,
- "current": 15,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:36:55.676Z",
- "deletedAt": null
}, - {
- "_id": "668fdff63a8d910335ec5ae7",
- "projectId": "demo-ecommerce",
- "eventId": "7a67b6b7-14bc-4a91-aefa-c2cdc6fd4741",
- "key": "state-delay-refund",
- "type": "statistic",
- "data": {
- "type": "number",
- "date": "2024-04-19T20:50:17.000Z",
- "raw": 259995,
- "current": 259995,
- "invalid": false,
- "anonymized": false
}, - "createdAt": "2024-07-11T13:36:54.075Z",
- "updatedAt": "2024-07-11T13:51:45.962Z",
- "deletedAt": null
}
], - "createdAt": "2024-07-11T13:36:53.922Z",
- "updatedAt": "2024-07-11T13:36:53.922Z"
}
Get event types
This endpoint allows you to retrieve the list of your project event-types.
The result is paginated.
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
query Parameters
offset | integer Example: offset=50 Items to skip (pagination) |
limit | integer Example: limit=10 Max returned items (pagination) |
search | string Example: search=form Pattern to search (in event type's name or reference) |
archived | boolean if set to true, returns the archived event types |
storageKey | string Example: storageKey=first_name Return only event types containing one field with the passed storage key |
reference | string Example: reference=contact-form Return the event types with the passed reference |
sort | string Example: sort=name,-createdAt Sort the event list by the passed fields. Ascending sort can be done by specifying the property name you want to sort by ( You can specify multiple sort by separating them with a comma ( |
Responses
Response samples
- 200
- 400
- 401
- 403
- 429
{- "total": 2,
- "count": 2,
- "data": [
- {
- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Generic Contact form",
- "fields": [
- {
- "type": "email",
- "entity": "user",
- "storageKey": "email",
- "ingestionKey": "email",
- "discriminant": true,
- "isPii": true,
- "isMostProbableLocation": false,
- "optional": false
}, - {
- "type": "message",
- "entity": "event",
- "storageKey": "message",
- "ingestionKey": "message",
- "discriminant": false,
- "isPii": false,
- "isMostProbableLocation": false,
- "optional": false
}
], - "metadata": {
- "form": "webmarketer"
}, - "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}, - {
- "_id": "64ea0e9db67c7a3a8310c633",
- "createdAt": "2023-06-21T10:57:00Z",
- "updatedAt": "2023-06-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "newsletter",
- "name": "Newsletter registration",
- "fields": [
- {
- "type": "email",
- "entity": "user",
- "storageKey": "email",
- "ingestionKey": "email",
- "discriminant": true,
- "isPii": true,
- "isMostProbableLocation": false,
- "optional": false
}
], - "metadata": {
- "form": "webmarketer"
}, - "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}
]
}
Create an event-type
This endpoint allows you to create a new event-type.
Request Body schema: application/jsonrequired
The event-type to create
reference | string Technical reference of the event type |
name | string The name of the event type (displayed in Webmarketer) |
Array of objects The fields, states and statistics of the event type | |
metadata | object The metadata of the event type, not used for now |
object |
Responses
Request samples
- Payload
{- "reference": "contact-form",
- "name": "Contact Form",
- "fields": [
- {
- "entity": "user",
- "type": "string",
- "storageKey": "phone",
- "ingestionKey": null,
- "optional": false,
- "discriminant": true,
- "isPii": false,
- "isMostProbableLocation": false
}
], - "metadata": { },
- "expirationPolicy": {
- "from": "project, event-type",
- "retentionDurationInDays": 365
}
}
Response samples
- 201
- 401
- 403
- 429
{- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Generic Contact form",
- "fields": [
- {
- "type": "email",
- "entity": "user",
- "storageKey": "email",
- "ingestionKey": "email",
- "discriminant": true,
- "isPii": true,
- "isMostProbableLocation": false,
- "optional": false
}, - {
- "type": "message",
- "entity": "event",
- "storageKey": "message",
- "ingestionKey": "message",
- "discriminant": false,
- "isPii": false,
- "isMostProbableLocation": false,
- "optional": false
}
], - "metadata": {
- "form": "webmarketer"
}, - "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}
Get an event type
This endpoint allows you to retrieve a specific event-type
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
id required | string The event type reference |
Responses
Response samples
- 200
- 401
- 403
- 404
- 429
{- "_id": "64ea0e9471360401bc438ef6",
- "createdAt": "2023-07-21T10:57:00Z",
- "updatedAt": "2023-08-26T14:35:00Z",
- "archivedAt": null,
- "projectId": "your-project",
- "reference": "contact-form",
- "name": "Generic Contact form",
- "fields": [
- {
- "type": "email",
- "entity": "user",
- "storageKey": "email",
- "ingestionKey": "email",
- "discriminant": true,
- "isPii": true,
- "isMostProbableLocation": false,
- "optional": false
}, - {
- "type": "message",
- "entity": "event",
- "storageKey": "message",
- "ingestionKey": "message",
- "discriminant": false,
- "isPii": false,
- "isMostProbableLocation": false,
- "optional": false
}
], - "metadata": {
- "form": "webmarketer"
}, - "phoneParsingConfig": [
- {
- "order": 1,
- "countryCode": "FR"
}, - {
- "order": 2,
- "countryCode": "BE"
}
]
}
Get custom campaigns
This endpoint allows you to retrieve a paginated list of custom campaigns for a Custom Ads integration.
You can filter the campaigns by active status, campaign ID, campaign slug, name, and explicit status.
Please note that campaign ID is different from the campaign slug. The campaign ID can be retrieved through the GET campaigns endpoint. The campaign slug is a user-defined identifier for the campaign to be used in the URL.
Explicit campaigns are campaigns that were explicitly created by the user. Implicit campaigns are campaigns
that were created by the system when traffic is detected with the integration wmktid
but no explicit campaign
slug is provided.
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
query Parameters
active | boolean Filter by active status (optional) |
campaignId | string Filter by campaign ID (optional) |
campaignSlug | string Filter by campaign slug (optional) |
nameLike | string Only include campaigns where the name match the given string, matching is case insensitive (optional) |
explicit | boolean Display campaigns which were explicitly / implicitly created (optional) |
sort | string (custom-ads-campaigns-campaign-filter-sort-type) Enum: "name" "campaignId" "active" Sort by field (optional) |
order | string (custom-ads-campaigns-order-type) Enum: "ASC" "DESC" Sort order (optional) |
offset | integer Example: offset=50 Campaigns to skip (pagination) |
limit | integer Example: limit=10 Max returned campaigns (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
{- "data": [
- {
- "id": "string",
- "integrationId": "string",
- "projectId": "string",
- "name": "string",
- "campaignSlug": "string",
- "active": true,
- "explicit": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "count": 0,
- "total": 0,
- "offset": 0,
- "limit": 0
}
Create custom campaign
This endpoint allows you to create a custom campaign for a Custom Ads integration.
Please note that :
- the campaign slug must be unique within the integration,
- the campaign will be declared as explicit (as it was created by a user).
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
Request Body schema: application/jsonrequired
campaignSlug required | string Campaign slug of your choice, the campaign slug will be used by Webmarketer to identify the campaign from the landing page URL. The campaign slug must be unique within the integration. |
name required | string The name of the Campaign, used in the Webmarketer interface |
active | boolean Default: true Campaign status (optional) |
Responses
Request samples
- Payload
{- "campaignSlug": "string",
- "name": "string",
- "active": true
}
Response samples
- 200
- 400
- 401
- 403
- 409
{- "id": "string"
}
Get a custom campaign
This endpoint allows you to retrieve a Custom Ads campaign for a given integration.
Note that the campaignId is not the same as the campaign slug, this id is generated by Webmarketer on campaign creation and can be retrieved through the GET campaigns endpoint.
Note that the returned campaign could be an implicit campaign, automatically created by the system when traffic is detected without any associated explicit campaign.
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
id required | string The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
{- "id": "string",
- "integrationId": "string",
- "projectId": "string",
- "name": "string",
- "campaignSlug": "string",
- "active": true,
- "explicit": true,
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
Update a custom campaign
This endpoint allows you to update a custom campaign for a Custom Ads integration.
You can update the campaign name and its active status.
path Parameters
id required | string The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Request Body schema: application/json
name | string Campaign name (optional) |
active | boolean Campaign status (optional) |
Responses
Request samples
- Payload
{- "name": "string",
- "active": true
}
Response samples
- 200
- 400
- 401
- 403
{- "modifiedCount": 0
}
Get a custom campaign outlays
This endpoint allows you to retrieve a paginated list of outlays for a given Custom Ads campaign.
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
query Parameters
sort | string (custom-ads-campaigns-outlay-filter-sort-type) Enum: "campaignId" "startDate" "endDate" "amount" "country" "region" Sort by field |
order | string (custom-ads-campaigns-order-type) Enum: "ASC" "DESC" Order by field |
since | string <date-time> Get outlays since this date |
until | string <date-time> Get outlays until this date |
offset | integer Example: offset=50 Outlays to skip (pagination) |
limit | integer Example: limit=10 Max returned outlays (pagination) |
Responses
Response samples
- 200
- 400
- 401
- 403
{- "data": [
- {
- "_id": "string",
- "projectId": "string",
- "integrationId": "string",
- "campaignId": "string",
- "amount": {
- "amount": 0,
- "currency": "string"
}, - "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string",
- "deletedAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
], - "count": 0,
- "total": 0,
- "offset": 0,
- "limit": 0
}
Create a custom campaign outlay
This endpoint allows you to create an outlay for a given Custom Ads campaign.
Region and country are optional fields and can be used to pass additional information about the outlay (for future reports in Webmarketer).
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
Request Body schema: application/jsonrequired
amount required | number The amount of the outlay, in the currency of the integration |
startDate required | string <date-time> The start date of the outlay, must be less than the end date |
endDate required | string <date-time> The end date of the outlay, must be greater than the start date |
country | string The country where the outlay was made, optional, not used yet |
region | string The region where the outlay was made, optional, not used yet |
Responses
Request samples
- Payload
{- "amount": 0,
- "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string"
}
Response samples
- 200
- 400
- 401
- 403
{- "id": "string"
}
Get a custom campaign outlay
This endpoint allows you to retrieve an outlay for a given Custom Ads campaign.
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
outlayId required | string The outlay Id |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
{- "_id": "string",
- "projectId": "string",
- "integrationId": "string",
- "campaignId": "string",
- "amount": {
- "amount": 0,
- "currency": "string"
}, - "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "country": "string",
- "region": "string",
- "deletedAt": "2019-08-24T14:15:22Z",
- "createdAt": "2019-08-24T14:15:22Z",
- "updatedAt": "2019-08-24T14:15:22Z"
}
Update a custom campaign outlay
This endpoint allows you to update an outlay for a given Custom Ads campaign.
Region and country are optional fields and can be used to pass additional information about the outlay (for future reports in Webmarketer).
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
wmktId required | string Webmarketer Id of the integration, can be found on the custom ads integration |
parentCampaignId required | string The parent campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
outlayId required | string The outlay ID |
Request Body schema: application/jsonrequired
amount | number |
startDate | string <date-time> |
endDate | string <date-time> |
campaignId | object The campaign ID Note that the campaign Id is different from the campaign slug. It can be retrieved through the GET campaigns endpoint. |
country | string |
region | string |
Responses
Request samples
- Payload
{- "amount": 0,
- "startDate": "2019-08-24T14:15:22Z",
- "endDate": "2019-08-24T14:15:22Z",
- "campaignId": { },
- "country": "string",
- "region": "string"
}
Response samples
- 200
- 400
- 401
- 403
- 404
{- "modifiedCount": 0
}
Create offline interaction
This endpoint allows you to create offline interaction.
An offline interaction is a user interaction with your brand out of your website that you want to track with Webmarketer.
Offline interaction can/should be only associated to a custom integration (eg: Google Spreadsheet) according to nodeData property.
nodeData property is used to identify the targeted advertiser node, you must provide a wmktId to allow Webmarketer to identify the integration and the advertiser needed properties (eg: cid for campaign ID).
userData property is used to identify the user, you must only provide identity field according to the project's user schema (eg: email, phone...).
Offline interaction ingestion is synchronous, so you will receive a 400 response if the interaction payload is invalid.
Authorizations:
path Parameters
projectId required | string (project_id) [ 3 .. 64 ] characters ^[a-z0-9]+(?:-[a-z0-9]+)*$ The queried Webmarketer project id |
Request Body schema: application/jsonrequired
date | string <date-time> Date of the offline interaction, see Date Specification section for more information. |
userData | object Data used to identify the user |
nodeData | object Data used to identify the advertiser node |
Responses
Request samples
- Payload
{- "date": "2023-08-01T22:00:00.000Z",
- "userData": {
- "email": "example@email.com"
}, - "nodeData": {
- "wmktId": "1234",
- "cid": "5678"
}
}
Response samples
- 400
- 401
- 403
- 429
{- "statusCode": 400,
- "message": "wmktId must be present in nodeData",
- "error": "Bad Request"
}