This page presents two HTTP post API endpoints that can be used for tracking from your server
Note:
To be able to query below APIs from a server, it will be required to pass API secret keywith each request for authentication.
Please store the API secret key safely as an environment variable on the server.
setReferral
This API can be used for user action like connecting wallet on your website and signing up, where we will register the user as referred invitee on success.
Please note, setAlias has been renamed to setReferral for better naming convention and avoiding any ambiguity. Though, setAlias endpoint is still available, but shall be deprecated soon.
setConversionEvents
This API can be used for sending conversion events with conversion value and revenue value for users already registered in the campaign as invitees.
set conversion events for invitees with conversion value and revenue value for a campaign
Request Body
Name
Type
Description
projectId*
String
Unique id of the project
campaignId*
String
Unique id of the campaign
events*
Array
checkout conversion event spec below
secretApiKey*
String
Secret API key which authenticates the calling server
{
successfulInvitees: [],
failedInvitees: [],
}
when API hits the limit of supporting at max 500 events
when all events don't have a valid wallet address and both conversion value or revenue value does not exist on each event.
Note:
Supports batch of multiple conversion events per invitee.
Each conversion event should belong to registered invitees only, otherwise it will simply fail for unregistered invitees. (setReferral must have called for each invitee)
Number of conversion events can be 500 as max and 1 as minimum to be processed successfully
Supports both positive and negative revenue values.
Returns successfulInvitees and failedInvitees as response
Conversion event spec
interface TokenSpec {
// The chain this token is on.
chainId: 'eth' | 'sol' | 'matic' | 'optimism';
// The token address of this token (called mint address for solana).
tokenAddress: string;
// The number of decimals this token has.
decimals: number;
symbol?: string;
// token name
name?: string;
// url of the image for token logo
logo?: string;
}
interface ConversionEventMetadata {
// token metadata for multiple token support
// To be sent with each event if campaign supports multiple tokens
// otherwise default campaign token will be used
conversion?: {
tokenMetadata?: TokenSpec;
};
// To be sent with each event if campaign supports multiple tokens
// otherwise default campaign token will be used
revenue?: {
tokenMetadata?: TokenSpec;
};
}
interface ConversionEvent {
// event name to uniquely identify conversion event
eventName: string;
// public wallet address of the invitee
inviteePublicKey: string;
// The referral code associated with invitee
referralCode?: string;
// revenue value driven by invitee
revenueValue?: number;
// conversion value driven by invitee
conversionValue?: number;
// Conversion event metadata
metadata?: ConversionEventMetadata;
}
Please contact us for setting up eventName as conversion event identifier.
FAQs
What is conversionValue?
Conversion value is a metric that is used for tracking campaign performance. We can provide any value that is considered important, we will aggregate that value and provide it per invitee/per referrer/per date and if there is any threshold defined in the campaign settings, we would compare the aggregated conversionValue against that to mark the registered invitee as converted and become eligible for rewards.
What is revenueValue?
Revenue value is another metric that is used for tracking campaign performance. We can provide any value that represents the revenue that we would be making from a user's conversion event.
For example, an invited user swaps 500$ on your Dapp and conversionThreshold was set to 500$ for the campaign and Dapp makes 5$ revenue out of that transaction. We can send below event to setConversionEvents API and it would mark the invited user as converted user along with updating total conversionValue, revenueValue for the campaign: