Skip to content

Instantly share code, notes, and snippets.

@vutran0111
Created August 8, 2017 02:23
Show Gist options
  • Save vutran0111/33c5f570c9cc31ce5def2e95227ab443 to your computer and use it in GitHub Desktop.
Save vutran0111/33c5f570c9cc31ce5def2e95227ab443 to your computer and use it in GitHub Desktop.
hook_data = {
"anonymousId"=>nil,
"channel"=>"server",
"context"=>{"library"=>{"name"=>"simple_segment", "version"=>"0.1.1"}},
"event"=>"signup",
"integrations"=>{},
"messageId"=>"api-bV5ZmieDrhHeMrqwsAqqUytqWec3q6EY",
"originalTimestamp"=>"2016-11-10T00:32:29+08:00",
"projectId"=>"3jjqD3uFsq",
"properties"=>nil,
"receivedAt"=>"2016-11-09T16:32:30.575Z",
"sentAt"=>"2016-11-09T16:32:29.000Z",
"timestamp"=>"2016-11-09T16:32:30.575Z",
"type"=>"track",
"userId"=>"some_user",
"identityId"=>"some_identity",
"source"=>"some_source",
"version"=>2
}
handler = SegmentHookHandler.new(hook_data)
handler.process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment