Affiliate Example

  1. 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>
  2. 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=adam

    Or with UTM parameters:

    https://example.com/?via=adam&utm_campaign=black+friday+sale
  3. You 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"})

Demo

No events emitted yet. Enter an event name and click "Emit".