Affiliate Example
Include the snippet below in your website's header to load the affiliate functionality:
<script src="https://pkg.basta.app/js/affiliate.js" basta-account-id="account-id" basta-cookie-consent="true"></script>When you direct users to your site via an affiliate link, a referral cookie is automatically created to associate the user with the affiliate. For example:
https://example.com/?via=adamOr with UTM parameters:
https://example.com/?via=adam&utm_campaign=black+friday+saleYou can also track user interactions by sending events with custom data that will be linked to the appropriate affiliate. For instance:
basta.emit("signup", { "hello": "world"})