Comment on page
📖
Referral APIs
The best thing about Tide's referral campaign is the ability to gate the program to relevant users only (e.g. referrers need to have performed at least 3 transactions in lending protocols) and reward participants only once on-chain actions have been completed by the referred users
Furthermore, the on-chain credentials are always up to date with the campaign state based on the actions completed and XP accumulated by users. Finally, our Referral API is a simple and effective tool to track your campaign's metrics and access extra features, such as a real-time leaderboard of the top referrers.
To start a new referral program, simply access the "My Campaigns" section of the Project Area, click on "New Campaign" and select the referral option.
The referral link is decided by the project while Tide will automatically append the unique
tideRef
property to track the attribution of referrers.After having created a Referral Campaign, you will find the Referral API Token on the campaign confirmation screen.

Where to find your Referral Api Token

Where to decide referral link
To track referral activities on your website, you can start interacting with the following endpoint:
post
https://api-prod.tideprotocol.xyz
/referral/track
Track any user action
This endpoint allows to track any user action. Our currently supported actions are:
ADD_REFERRED: use this when a user has been referred on your website
COMPLETE_REFERRAL: use this when a user completes a goal on your website
PAGE_VIEW: optionally use this whenever a referred user views a page on your website
Parameters
Header
authorization*
string
Bearer ${REFERRAL_API_TOKEN}
Content-Type
string
application/json
Body
action*
string
can be: "ADD_REFERRED",
"COMPLETE_REFERRAL",
"PAGE_VIEW"
userAddress*
string
the address of the user who performed the action that is being tracked
referralId*
string
referral id that was on the link used by the referred user. This field is only optional if the action is "PAGE_VIEW"
pageViewUrl
string
URL for the page view event. Only required if the action is "PAGE_VIEW"
Responses
200: OK
Ok
Next, we invite you to continue your exploration by diving into the SDK documentation. Tide Referral SDK documentation provides valuable insights into integrating our library into your applications, configuring the environment, and leveraging additional functionalities. It serves as a companion guide to the API documentation, enabling you to harness the full potential of our library.
To access the SDK documentation, simply navigate to the next page or click on the "Tide Referral SDK" link in the documentation menu.
Last modified 4mo ago