Skip to content

Instantly share code, notes, and snippets.

@reggi
Created April 16, 2014 22:53
Show Gist options
  • Save reggi/10940402 to your computer and use it in GitHub Desktop.
Save reggi/10940402 to your computer and use it in GitHub Desktop.
To any and all looking to make a klaviyo request.
var request = require("request");
var klaviyoRequest = function(data, callback){
var dataJsonString = JSON.stringify(data);
var dataBuffer = new Buffer(dataJsonString);
var dataBase64 = dataBuffer.toString("base64");
request({
"url": "https://a.klaviyo.com/api/track",
"qs": {
"data": dataBase64,
}
}, callback
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment