If desired, Sticky.ID can be integrated using JSON-P. This method involves injecting the Stick.ID URL as a <script> into the DOM, passing a callback function name in the URL. Our script will call the function specified, passing into it the Sticky.ID payload.

Get user's Sticky.ID with a JSON-P callback

window.callbackFn = function(response) {
  var globalUserId = response.id;
  var timestamp = response.ts;
  var cookieSupport = response.cs;
var scr = document.createElement('script');
scr.src = 'https://stickyid-a.akamaihd.net/id?cb=callbackFn';

Example response

The response is similar to what is returned in a normal request. However, because it includes the cb= parameter, the resulting object will be wrapped in a Javascript function call. An example response when including cb=callbackFn on the Sticky.ID URL: