-
-
Save Burgov/5384c5c744e1e59ef71b22a9b083d306 to your computer and use it in GitHub Desktop.
Frits Tracking at Affiliate
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
// 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