Skip to content

Instantly share code, notes, and snippets.

@Burgov
Forked from stijnjanmaat/fritsTracking.js
Last active August 31, 2021 12:42
Show Gist options
  • Save Burgov/5384c5c744e1e59ef71b22a9b083d306 to your computer and use it in GitHub Desktop.
Save Burgov/5384c5c744e1e59ef71b22a9b083d306 to your computer and use it in GitHub Desktop.
Frits Tracking at Affiliate
// Managed by Frits
const init = () => {
let _handler = () => {}; // just an empty function in case no listener is registered.
setTimeout(() => {
_handler({ myEventData: 'something' });
}, 1000);
return {
onEvent: (handler) => { _handler = handler }
}
}
// Created by affiliate, e.g. Consumentenbond
const frits = init();
frits.onEvent(event => {
// implement tracking lib here
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment