Skip to content

Instantly share code, notes, and snippets.

@reinpk
Last active January 1, 2016 17:09
Show Gist options
  • Save reinpk/7bd33d29694578b06cce to your computer and use it in GitHub Desktop.
Save reinpk/7bd33d29694578b06cce to your computer and use it in GitHub Desktop.

Track:

{
    "secret"     : "YOUR_WRITE_KEY",
    "requestId"  : "1d2a3fe1f2d3ae1f2d3f1ea",
    "userId"     : "019mr8mf4r",
    "event"      : "Purchased an Item",
    "properties" : {
        "revenue"        : "39.95",
        "shippingMethod" : "2-day"
    },
    "context"   : {
        "providers" : { "all": false, "Mixpanel": true }
    },
    "timestamp"  : "2012-12-02T00:30:08.276Z"
}

Identify:

{
    "secret"    : "YOUR_WRITE_KEY",
    "requestId"  : "1d2a3fe1f2d3ae1f2d3f1ea",
    "userId"    : "019mr8mf4r",
    "traits"    : {
        "email"            : "achilles@segment.io",
        "name"             : "Achilles",
        "subscriptionPlan" : "Premium",
        "friendCount"      : 29
    },
    "context"   : {
        "providers" : { "all": false, "Mixpanel": true }
    },
    "timestamp" : "2012-12-02T00:30:08.276Z"
}

Batch:

{
    "secret" : "YOUR_WRITE_KEY",
    "requestTimestamp" : "2012-12-02T00:30:08.276Z",
    "batch"  : [
        {
            "action"     : "track",
            "requestId"  : "1d2a3fe1f2d3ae1f2d3f1ea",
            "sessionId"  : "DKGXt384hFDT82D",
            "userId"     : "019mr8mf4r",
            "event"      : "Purchased an Item",
            "properties" : {
                "revenue"        : "39.95",
                "shippingMethod" : "2-day"
            },
            "context"   : {
                "providers" : { "all": false, "Mixpanel": true }
            },
            "timestamp"  : "2012-12-02T00:30:08.276Z"
        },
        {
            "action"    : "identify",
            "requestId"  : "98989a8ff9a8e8f9a8126",
            "sessionId" : "DKGXt384hFDT82D",
            "userId"    : "019mr8mf4r",
            "traits"    : {
                "email"            : "achilles@segment.io",
                "name"             : "Achilles",
                "subscriptionPlan" : "Premium",
                "friendCount"      : 29
            },
            "context"   : {
                "providers" : { "all": false, "Mixpanel": true }
            },
            "timestamp" : "2012-12-02T00:30:08.276Z"
        },
        {
            "action" : "alias",
            "requestId"  : "efad6152031200eaf9a09f89",
            "from"   : "DKGXt384hFDT82D",
            "to"     : "019mr8mf4r",
            "context"   : {
                "providers" : { "all": false, "Mixpanel": true }
            },
            "timestamp" : "2012-12-02T00:30:08.276Z"
        }
    ]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment