Installing the AffRank Script
Complete guide to installing the AffRank tracking script on any website platform.
Quick Install
The easiest way to install AffRank:
- Get your script from Script Generator in dashboard
- Add to your website’s
<head>section:<script src="https://affrank.io/script/YOUR_USER_ID.js"></script> - Save and deploy
- Done! ✅
Installation Methods
Method 1: Direct HTML (Static Sites)
Add the script directly to your HTML:
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>My Website</title>
<!-- AffRank Script --> <script src="https://affrank.io/script/YOUR_USER_ID.js"></script></head><body> <h1>Welcome</h1></body></html>Method 2: Website Admin Panel
For most platforms (WordPress, Shopify, Wix, Squarespace, Webflow, Ghost, Google Sites, etc.):
- Log into your website’s admin panel/dashboard
- Find Custom Code, Code Injection, or Header section
- Paste the AffRank script
- Save changes
Common Locations:
- WordPress: Appearance → Theme File Editor → header.php
- Shopify: Settings → Checkout → Additional scripts
- Wix: Settings → Custom Code → Head
- Squarespace: Settings → Advanced → Code Injection → Header
- Webflow: Settings → Custom Code → Head Code
- Ghost: Settings → Code Injection → Header
Method 3: Google Tag Manager
For any website:
- Open Google Tag Manager (tagmanager.google.com)
- Click Create Tag → Custom HTML
- Paste your AffRank script
- Create trigger: All Pages
- Save and publish
Verification
After installation, verify script loaded:
In Browser Console
- Visit your website
- Press F12 (or right-click → Inspect)
- Click Console tab
- Look for message:
AffRank v1.x loaded successfully
In Network Tab
- Press F12
- Click Network tab
- Refresh page
- Look for request to
affrank.io/script/... - Should show Status: 200
Check in Dashboard
- Go to Domain Management
- Find your domain
- Should show Verified ✅
Installation Checklist
✅ Located script in Script Generator
✅ Copied entire script tag (including URL)
✅ Found <head> section of website
✅ Pasted script in correct location
✅ Saved changes
✅ Deployed/published to live website
✅ Verified script loads in browser console
✅ Domain registered in AffRank
✅ Domain verifies in dashboard
Troubleshooting Installation
Script won’t load
Check:
- User ID is correct in script URL
- Script tag is complete:
<script>...</script> - URL is exactly:
https://affrank.io/script/YOUR_USER_ID.js - No typos in URL
Fix:
- Copy fresh script from dashboard
- Clear browser cache (Ctrl+Shift+Del)
- Try incognito window
- Verify internet connection
- Try different browser
Console shows error
Common errors:
| Error | Solution |
|---|---|
404 Not Found | User ID is wrong, copy from dashboard |
Refused to execute | Script blocked by extension/firewall |
Uncaught SyntaxError | Script corrupted, re-copy from dashboard |
CORS error | Browser security issue, try different browser |
Domain won’t verify
Solutions:
- Wait 5-10 minutes after installing script
- Visit your website once to trigger script load
- Clear browser cache
- Verify script is in
<head>tag - Check script loads without errors (F12 console)
- Try different verification method
Platform Support Matrix
| Platform | Support | Method |
|---|---|---|
| WordPress | ✅ Full | Plugin or manual |
| Shopify | ✅ Full | Settings |
| Wix | ✅ Full | Custom Code |
| Squarespace | ✅ Full | Code Injection |
| Webflow | ✅ Full | Custom Code |
| Ghost | ✅ Full | Code Injection |
| Blogger | ✅ Full | Edit HTML |
| HTML/Static | ✅ Full | Direct edit |
| Google Sites | ✅ Full | Embed code |
| Drupal | ✅ Full | GTM or custom |
| Joomla | ✅ Full | Module/plugin |
Advanced: Multiple Domains
To track multiple websites with one account:
- Generate one script (same ID)
- Install on all websites
- Each domain auto-identified by referer
- All domains in one dashboard
- Create links visible to all domains
Security Notes
- AffRank script is served over HTTPS
- No sensitive data collected
- Works with security plugins
- Does not interfere with SSL certificates
- Compatible with privacy regulations