πŸŽ›οΈTracking Referrals

For Fuul to attribute conversions to the right referrer, your app must send two tracking events: pageview and connect_wallet (via identifyUser).

circle-info

These events require the send:tracking_event API key. See API Key Management.

How attribution works

User clicks referral link β†’ pageview event β†’ user connects wallet β†’ identifyUser event
                                   ↓                                        ↓
                         Captures referrer info                Links wallet to tracking session
                                   ↓                                        ↓
                            Later, user converts β†’ Fuul attributes conversion to the referrer

1. Send pageview

Call sendPageview on every page load. The SDK automatically captures the referrer's affiliate code from the URL (?referrer=code) and stores a tracking ID in localStorage.

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

await Fuul.sendPageview();
circle-info

The SDK reads referral parameters from the URL automatically. You don't need to persist them when navigating between pages.

2. Identify the user

Call identifyUser every time a user connects a wallet or logs in β€” including when they switch wallets during a session. This sends a connect_wallet event that links their identity to the tracking session.

Smart contract wallets

For smart contract wallets (EIP-1271), add the accountChainId parameter:

Supported chains for smart contract wallets:

Network
Chain ID

Ethereum

1

Arbitrum

42161

Optimism

10

Base

8453

Polygon

137

zkSync Era

324

BNB Chain

56

Avalanche

43114

Mode

34443

Abstract

2741

Bob

60808

Berachain

80094

XRPL signatures

For XRPL wallets, include the signaturePublicKey:

Sending identifyUser from the backend

If you identify users server-side, send the connect_wallet event via the REST API. You'll need the tracking_id from the browser's localStorage (key: fuul.tracking_id) β€” it must match the one sent in the pageview event.

Signature types

Fuul supports two signature verification methods:

Type
Verification
Use case

Regular message

Standard EOA wallets

Typed data (EIP-712)

Structured data signing

For typed data signatures, stringify the typed data object:

circle-info

Requiring users to sign a message ensures event validity and prevents attribution fraud. This is mandatory.

Last updated