SDK Installation
Install the Geddle SDK on your website to track affiliate referrals and conversions
SDK Installation
Add the Geddle SDK to your website to track affiliate referrals.
Installation
- Go to Partner Dashboard → Products → Your Product
- Scroll to SDK Integration
- Copy the script tag
- Paste in your
<head>or before</body>
<script
async
src="https://geddle.com/sdk/latest.js"
data-product-id="YOUR_PRODUCT_ID"
data-cookie-duration="60"
></script>
Configuration
<script
async
src="https://geddle.com/sdk/latest.js"
data-product-id="prod_abc123"
data-cookie-duration="60"
data-attribution-model="last-click"
></script>
data-product-id (required): Your product ID from dashboard
data-cookie-duration (optional): Cookie lifetime in days. Default: 60
data-attribution-model (optional): last-click (default) or first-click
last-click: Most recent affiliate link gets commissionfirst-click: First affiliate link gets commission
Framework-Specific Installation
Next.js
Next.js provides built-in Script optimization that makes it easy to add the Geddle SDK with optimal loading performance.
App Router Installation
Add the SDK to your root layout for consistent tracking across all pages.
- Open your root layout file at
app/layout.tsx(orapp/layout.jsx) - Import the Script component from
next/script - Add the Geddle SDK script with optimal loading strategy:
import Script from 'next/script'
export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang='en'>
<head>
<Script
async
src='https://geddle.com/sdk/latest.js'
data-product-id='YOUR_PRODUCT_ID'
data-cookie-duration='60'
strategy='afterInteractive'
/>
)
}
Script Strategy Options
afterInteractive(recommended): Loads after the page is interactivelazyOnload: Loads during idle timebeforeInteractive: Loads before page is interactive (use only if critical)
Verification
Go to Partner Dashboard → Products → Your Product → SDK Integration. It should show "SDK Script: Detected on website".
The SDK detects referral codes from ?ref=CODE, ?aff=CODE, ?via=CODE, or ?r=CODE and stores a tracking ID in the geddle_referral cookie (or localStorage if cookies are blocked).
Related Articles
Need more help?
Can't find what you're looking for? Our support team is here to help.