Created
April 24, 2014 08:56
-
-
Save msmithstubbs/11247189 to your computer and use it in GitHub Desktop.
BIS conversion tracking
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
| 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