Skip to content

Instantly share code, notes, and snippets.

@plcstevens
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plcstevens/fcfdbfb226b8541b4bfa to your computer and use it in GitHub Desktop.
Save plcstevens/fcfdbfb226b8541b4bfa to your computer and use it in GitHub Desktop.
This is how we can allow users to call ReevooMark api actions from outside of our callbacks. Please note as this is all asynchronous, ReevooMark is not guaranteed to exist. Therefore this should only be used when the call to ReevooMark occurs some time after page load.
(function() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = '//cdn.mark.reevoo.com/assets/reevoo_mark.js';
var s = document.getElementById('reevoomark-loader');
s.parentNode.insertBefore(script, s);
})();
afterReevooMarkLoaded = [function() {
ReevooApi.load('YOUR_TRKREF', function(retailer) {
if (window && window.ReevooMark === undefined) {
window.ReevooMark = retailer;
}
retailer.init_badges();
});
}];
@plcstevens
Copy link
Author

For example a client could now use the following code example elsewhere on their page.

<a onclick="ReevooMark.track_purchase('ETC')">

Please note that this implementation DOES NOT SUPPORT multiple TRKREFs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment