Creating affiliates tracking links using the Fuul SDK

This article shows how to create tracking links programmatically with the Fuul SDK.

To create tracking links use the generateTrackingLink method. This generates a tracking link for the affiliate to share your program link.

import { Fuul } from ('@fuul/sdk');

const trackingLinkUrl = await Fuul.generateTrackingLink(
    baseURL, affiliateAddress)

// Returns
"http://yourwebsite.com?af=<affiliateAddressOrCode>"

baseURL: the URL of your website (where the pageview and connect wallet events are implemented)

affiliateAddress: the address of the affiliate. Usually, it is the one that is connected to the site.

If the affiliateAddress has already created an affiliate code on Fuul, this code will be automatically inputted on the link instead of the address. Check this guide for more information on how to create affiliate codes.

You can find an example of two landing pages (one for creators and another one for end users) with the Fuul SDK integrated using next JS and RainbowKit in this repo

Last updated