ChainVine API Docs
  • Chainvine
    • Product and Features
    • Technical Overview
  • ⚙️Developers
    • 🔨Use Cases
      • Leverage cookies
      • Link Claimer/Referrer
      • Record Link Click
      • Generate a Referrer Link
      • Record a Transfer Event
      • Complete a Requirement
    • 🖼️Embedded Widget
      • Implementation
      • FAQ
    • 🧰SDK
      • Implementation
      • Configuring the Client
      • Classes and Functions
        • Utility Methods
        • ChainvineClient
          • getReferralUrl(walletAddress)
          • recordClick(referrer)
          • linkReferrer([payload,])
          • referralConversion([payload,])
          • syncUser(walletAddress)
          • getCampaignReferralStats([payload,])
        • ChainvineUser
          • Initializing the client
          • joinCampaign([campaignParams,])
          • getRequirement([payload,])
          • getUserStats([payload,])
          • verifyRequirement([payload,])
          • completeRequirement([payload,])
          • claimEligibleEarnings([payload,])
          • transferEvent([payload,])
          • referral([campaignParams,])
            • linkToReferrer(referrer)
            • url()
          • setRewardTiersOverride([payload,])
        • Errors
        • Authentication
          • Getting your API Key
          • Allow-listing a domain
      • FAQ
    • 🪝Webhooks
    • 📔Open API Specification
  • Rewards
    • Claiming For Users
      • On ChainVine
Powered by GitBook
On this page
  • Pre-requisites
  • Best practices
  • Examples
  1. Developers
  2. Use Cases

Record Link Click

Pre-requisites

  • Implement the SDK's recommended Cookie Management approach

Best practices

  • Fetch the referrer_id using the getReferrerId() method

  • be sure to only call this method when appropriate so as to avoid sending false events!

Examples

import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient(); //Make sure to whitelist your domain

await client.recordClick(
    'ABC123', // the referrer from the referral link
    'aSlug123' // Optional, the campaign slug/id to record the click for (if you have multiple active campaigns)
); 
import { ChainvineClient } from '@chainvine/sdk';

const client = new ChainvineClient({
    apiKey: '9dj022didj', //your api key
});

await client.recordClick(
    'ABC123', // the referrer from the referral link
    'aSlug123' // Optional, the campaign slug/id to record the click for (if you have multiple active campaigns)
); 
PreviousLink Claimer/ReferrerNextGenerate a Referrer Link

Last updated 1 year ago

⚙️
🔨