Import raw visit data with actions and visitor properties
The Import API allow you to bulk fill events and visitor properties into your Woopra instance in a single transaction.
This endpoint accepts an http body of line-separated JSON. This means, a single JSON object represented as a string (without the outer quotes) on each line. For Example:
{"visitor":{"email":"[email protected]"}, "actions":[{"time":1444077951001, "name":"purchase", "properties":{"price":20, "currency":"$"}]}
{"visitor":{"email":"[email protected]", "username": "test2"}, "actions":[{"time":1444077951891, "name":"signup", "properties":{"campaign": true}}]}
...
Importing Visits
Each line in the body that you POST to /import should be a visit, a.k.a. session. The visit object should include a nested actions array, and a visitor object. At minimum, the visitor object should have an identifier so that Woopra knows to which person profile this visit belongs. The actions array is an array of event objects, each of which has a name
, a time
(in UNIX milliseconds), and a properties
object with the custom event properties.
It is very conceivable that a visitor will have multiple lines in this file as they have done a number of visits, each expressed on its own line, and each containing an array of actions performed on this visit.
Bulk Updating Visitor Properties
You can bulk update visitor properties without tracking any actions by only including visitor information on each line. So each line would omit the actions
array, and other visit properties, and look like:
{
"visitor": {
"email": "<email>",
"account_level": "enterprise",
"property1": "prop1Value"
}
}
A note on generated visit properties
NOTE: while you cannot send generated visit properties when doing real-time tracking (becasue they are generated) the tracking servers do not generate these fields on imports, and thus, you can send them. Imports go straight into the events database as is (more or less) and the logic that we run before write time at the end of a normal session in real-time tracking, is not run in the case of imported sessions via this endpoint. They are written as is.
A note on Engagement
Similarly, the Woopra system does not run engagement on imported data. This means that labels, triggers, and other automations are not evaluated for imported events.