Skip to content

Instantly share code, notes, and snippets.

@msmithstubbs
Created April 24, 2014 08:56
Show Gist options
  • Select an option

  • Save msmithstubbs/11247189 to your computer and use it in GitHub Desktop.

Select an option

Save msmithstubbs/11247189 to your computer and use it in GitHub Desktop.
BIS conversion tracking
if (window.location.toString().match(/bis_id/)) {
function getJsonFromUrl() {
var query = location.search.substr(1);
var data = query.split("&");
var result = {};
for(var i=0; i<data.length; i++) {
var item = data[i].split("=");
result[item[0]] = item[1];
}
return result;
}
var data = getJsonFromUrl();
$.ajax({url: '/cart/update.js', method: 'post', data: { attributes: { bis_id: data['bis_id'] }}})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment