@ref247/tracker-embed
v2.0.7
Published
Ref247.io tracker embed script for your websites!
Downloads
29
Maintainers
Readme
@ref247/tracker
Official client-side SDK for tracking affiliate clicks with Ref247.io.
✨ Features
- Simple API to track clicks and store affiliation information
- Lightweight and framework-agnostic
Usage Example
- As an npm package
npm install @ref247/tracker-embedimport Ref247TrackerEmbed from '@ref247/tracker-embed';
const data = Ref247TrackerEmbed.getData();
console.log(data);- HTML
<script src="https://cdn.ref247.io/embed.umd.js"></script>
<script>
// Wait for the script to load and initialize
window.addEventListener('load', () => {
if (window.Ref247TrackerEmbed) {
const data = Ref247TrackerEmbed.getData()
console.log('Ref247 embed data:', data);
// use data.affId in your signup process
} else {
console.error('Ref247TrackerEmbed is not loaded.');
}
});
</script>