Sending Past Events

If you have migrated from another service or just created a Reteno account, and you have a history of

  • user activity,
  • subscriptions,
  • or other events you want to use for advanced segmentation.

You can transfer the available event data from your CRM or other data store to the Reteno system via the API resource Generate past events.

📘

Important

Before importing events, enable segmentation for the types of events you want to download.

If your tariff plan does not include segmentation by events, please submit a request to [email protected].

How to set up segmentation by events >

To assign events to users, pre-import the contact list to your Reteno account.

For example, you have a certain number of course subscriptions over the past year, and you want to build a segment with users interested in a certain type of courses, get statistics on the number of subscriptions, or segment users by geodata (if applicable).

Convert these subscriptions info into a JSON format supported for API according to the specification, and send them to the Reteno system. You can send an array of up to 500 such events within one request. Specify the time of each event in the field occurred. Format of date: YYYY-MM-DD; format of date with the time: YYYY-MM-DDTHH:mm.

For example, you send the information on two course subscriptions:

{
	"events": [{
			"eventTypeKey": "orderCreated",
			"keyValue": "[email protected]",
			"params": [{
				"name": "email",
				"value": "[email protected]"
			}, {
				"name": "externalOrderId",
				"value": "9239234234234"
			}, {
				"name": "externalCustomerId",
				"value": "d8b6a037-4b6d-11eb-a2f0-0050569b2dc99902"
			}, {
				"name": "totalCost",
				"value": "2258.0"
			}, {
				"name": "status",
				"value": "INITIALIZED"
			}, {
				"name": "date",
				"value": "2020-05-14T10:11:00"
			}, {
				"name": "currency",
				"value": "UAH"
			}, {
				"name": "items",
				"value": [{
					"externalItemId": "200600",
					"name": "Business English",
					"category": "Courses",
					"quantity": 1,
					"cost": 2258.0,
					"url": "http://example.com/item/200600",
					"imageUrl": "http://example.com/item/200600/image.png",
					"description": "Online classes"
				}]
			}],
			"occurred": "2023-03-22T14:30"
		},

		{
			"eventTypeKey": "orderCreated",
			"keyValue": "[email protected]",
			"params": [{
				"name": "email",
				"value": "[email protected]"
			}, {
				"name": "externalOrderId",
				"value": "9239234235555"
			}, {
				"name": "externalCustomerId",
				"value": "d8b6a578-4b6d-11eb-a2f0-0050569b2dc99902"
			}, {
				"name": "totalCost",
				"value": "5460.0"
			}, {
				"name": "status",
				"value": "INITIALIZED"
			}, {
				"name": "date",
				"value": "2020-05-14T11:11:00"
			}, {
				"name": "currency",
				"value": "UAH"
			}, {
				"name": "items",
				"value": [{
					"externalItemId": "200601",
					"name": "Business Spanish",
					"category": "Courses",
					"quantity": 2,
					"cost": 2730,
					"url": "http://example.com/item/200601",
					"imageUrl": "http://example.com/item/200601/image.png",
					"description": "Online classes"
				}]
			}],
			"occurred": "2023-03-22T15:30"
		}
	]
}

Apart from basic fields with the name, cost and link to the course, you can send any related data that will be available to build segments. For example, you can send the country and city of the subscriber.

{
    "name": "city",
    "value": "Los Angeles"
 },{
    "name": "country",
    "value": "USA"
}

And then use these parameters for segmentation by geolocation.

Dynamic segment

For deleting old or irrelevant events, send a request to the resource Remove events, using the method type DELETE. Specify the time range to remove in the request body:

{
    "from" : "2019-06-04T10:47",
    "to" : "2020-01-04T13:33"
}

The method DELETE is inactive by default. To activate it, please contact our support at [email protected].