Last active
August 29, 2015 14:27
-
-
Save pekkis/33e6e6e00dd177c81fff to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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