Created
April 5, 2017 12:00
-
-
Save oarashi/d0484d6b5471e4c5413a1054c0ebde77 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
window._talkableq = window._talkableq || []; | |
_talkableq.unshift(['init', {site_id: 'le-chateau'}]); | |
var isCurrentPath = function(paths) { | |
for (var i = 0; i < paths.length; i++) | |
if (document.location.href.indexOf(paths[i]) > -1) | |
return true; | |
return false; | |
}; | |
// Post Purchase | |
window.talkable.before('register_purchase', function(data) { | |
if (!data.purchase) return; | |
if (!isCurrentPath(['/style/cart/', '/style/checkout/'])) { | |
data.campaign_tags = '404'; | |
} | |
return data; | |
}); | |
// Widget | |
window.talkable.before('register_affiliate', function(data) { | |
if (!data || isCurrentPath(['/style/cart/', '/style/checkout/'])) return; | |
return data; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment