Skip to content

Instantly share code, notes, and snippets.

@gooley
Last active August 29, 2015 14:03
Show Gist options
  • Save gooley/a72ac96a7e92fc82394d to your computer and use it in GitHub Desktop.
Save gooley/a72ac96a7e92fc82394d to your computer and use it in GitHub Desktop.
Backfill Example - Data Formats
// User Event
{
"person": {
"email": "[email protected]",
"name": "Christopher Gooley",
"created_at": 1404329291.5481384,
"uid": "383838211"
}
"event": {
"name": "viewed:customer",
"timestamp": 1404329291.5637133, // timestamp is critical for backfills
"note": "Scott Kriz", // note is a human-readable field
"target_id": "2345", // if applicable, the id of the "object" this event acted on
"account": {
"id": "828492", // id of the account in your database
"name": "Adobe" // name of the account
},
"extras": {
// these are special fields that you can pass if you have them, otherwise you can omit the extras
"_ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3)",
"_page_title": "Preact :: Account Health",
"_ip": "74.125.239.100",
"_referer": "http://google.com?q=preact",
"_url": "http://preact.com/awesome-page"
}
}
}
// Background Signal
{
"account_id": "54321",
"name": "total-sms-sent",
"value": 691.751, // current value (typically 'so far this [year|month|week]')
"ts": 1404329291.570334
}
// Account-Only Event
// (only for events which were not performed by a logged-in user)
// NOTE: These are usually very rare and are often either a normal User Event or should be a Background Signal
{
"event": {
"klass": "accountevent", // REQUIRED - to specify that no person should be expected
"name": "billing-failed",
"timestamp": 1404329291.5637133,
"note": "Card Expired", // note is a human-readable field
"account": {
"id": "828492", // id of the account in your database
"name": "Adobe" // name of the account
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment