Installing the Script
Your AffRank script is a single <script> tag that belongs in your site’s <head>. Once it’s there, AffRank handles everything else automatically.
Your script tag
Find your unique script in Dashboard → Domain & Script:
<script src="https://api.affrank.ai/api/affiliate/engine/YOUR_USER_ID.js"></script>Replace YOUR_USER_ID with the ID shown in your dashboard. This same script works across all your verified domains.
Platform instructions
WordPress
Use the Insert Headers and Footers plugin (free, by WPBeginner):
- Install and activate the plugin
- Go to Settings → Insert Headers and Footers
- Paste your script into the Scripts in Header box
- Click Save
Shopify
- Online Store → Themes → Edit code
- Open
theme.liquid - Paste the script just before
</head> - Click Save
Webflow
- Site Settings → Custom Code
- Paste into the Head Code field
- Publish your site
Squarespace
- Settings → Advanced → Code Injection
- Paste into the Header field
- Save
Wix
- Settings → Custom Code
- Click + Add Custom Code
- Paste the script, set placement to Head, apply to All Pages
- Save and publish
Next.js
In app/layout.tsx (App Router):
import Script from 'next/script'
export default function RootLayout({ children }) { return ( <html> <head> <Script src="https://api.affrank.ai/api/affiliate/engine/YOUR_USER_ID.js" strategy="afterInteractive" /> </head> <body>{children}</body> </html> )}Google Tag Manager
- Tags → New → Custom HTML
- Paste your script tag
- Triggering: All Pages
- Save and publish the container
GTM works with any platform — if your site already uses GTM, this is the easiest path.
Static HTML
Paste directly into the <head> of your HTML files:
<!DOCTYPE html><html><head> <title>My Site</title> <script src="https://api.affrank.ai/api/affiliate/engine/YOUR_USER_ID.js"></script></head><body>...</body></html>Verifying the script is installed
- Open your website in Chrome or Firefox
- Press F12 → Network tab
- Refresh the page
- Search for
enginein the request list - You should see a request to
api.affrank.aiwith status 200
A 200 status means the script is loading correctly.
After installation
Go back to your AffRank dashboard, visit your website once to fire the signal, then click Verify next to your domain within 10 minutes. See Setting Up Your First Domain for the full verification steps.