Skip to content

Instantly share code, notes, and snippets.

@boomtrain-support
Created August 31, 2015 17:43
Show Gist options
  • Select an option

  • Save boomtrain-support/f5abb313a0fe87df4076 to your computer and use it in GitHub Desktop.

Select an option

Save boomtrain-support/f5abb313a0fe87df4076 to your computer and use it in GitHub Desktop.
POST /event/track - An example request for this endpoint using jQuery
<script>
function eventTrack() {
// JSON stringify the data
var json_data = JSON.stringify({
'type': '{Event Type}',
'model': '{Model Type}',
'id': '{Resource ID}',
'userId': '{User ID}',
'timestamp': '{ISO Formatted Timestamp, will be generated if not specified}'
});
// Send a jQuery AJAX request to track the new event
$.ajax({
url: 'https://events.boomtrain.com/event/track',
// Replace your Username, Password, and App Id
headers: {
'x-app-id': '{Your App Id}',
'Content-Type': 'application/json',
'Authorization': 'Basic ' + btoa('{Your Username}:{Your Password}')
},
type: 'POST',
data: json_data,
success: function(msg) {
console.log(msg)
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment