Created
May 31, 2018 10:33
-
-
Save moski/de95016d04fd43ad69c0058645d4b0c4 to your computer and use it in GitHub Desktop.
example.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require("request"); | |
var options = { | |
method: 'POST', | |
url: 'https://trackcmp.net/event', | |
headers: { | |
//Add Headers here if needed | |
}, | |
json: { | |
actid: 23033, | |
key: "c12973b078007927842301eff932e7d78b74b3e", | |
event: "YOUR_EVENT", | |
eventdata: "ANY_DATA", | |
visit: { | |
email: "" | |
} | |
} | |
}; | |
request(options, function (error, response, result) { | |
if (error) { //Fail when firing the request | |
console.log('CURL failed to run: ' + error); | |
return; | |
} | |
if (result.success) { | |
console.log('Success! '); | |
} else { | |
console.log('Error! '); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment