Skip to content

Instantly share code, notes, and snippets.

@pekkis
Last active August 29, 2015 14:27
Show Gist options
  • Save pekkis/33e6e6e00dd177c81fff to your computer and use it in GitHub Desktop.
Save pekkis/33e6e6e00dd177c81fff to your computer and use it in GitHub Desktop.
jQuery.ajax({
xhrFields: {
withCredentials: true
},
dataType: 'json',
url:'http://cookie-jar.frakt.io/uuid',
success: function(p) {
jQuery.ajax({
url:'http://52.18.241.27/uuid/' + p.uuid + '.json',
dataType:'json',
success: function(data) {
var segmentsString = "";
for (index = 0; index < data.array.length; index++) {
var exploded = data.array[index].string.split(':');
var targetName = exploded[0];
var segmentId = exploded[1];
if (targetName === 'Adform') {
segmentsString += "&sg=" + segmentId;
}
}
var adfimage = new Image();
adfimage.id = "tc_img_45_1";
adfimage.src = 'http://dmp.adform.net/dmp/profile/?pid=10237' + segmentsString;
adfimage.style.display = 'none';
document.getElementsByTagName('body')[0].appendChild(adfimage);
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment