Skip to content

Installing the AffRank Script

Complete guide to installing the AffRank tracking script on any website platform.

Quick Install

The easiest way to install AffRank:

  1. Get your script from Script Generator in dashboard
  2. Add to your website’s <head> section:
    <script src="https://affrank.io/script/YOUR_USER_ID.js"></script>
  3. Save and deploy
  4. 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.):

  1. Log into your website’s admin panel/dashboard
  2. Find Custom Code, Code Injection, or Header section
  3. Paste the AffRank script
  4. 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:

  1. Open Google Tag Manager (tagmanager.google.com)
  2. Click Create TagCustom HTML
  3. Paste your AffRank script
  4. Create trigger: All Pages
  5. Save and publish

Verification

After installation, verify script loaded:

In Browser Console

  1. Visit your website
  2. Press F12 (or right-click → Inspect)
  3. Click Console tab
  4. Look for message:
    AffRank v1.x loaded successfully

In Network Tab

  1. Press F12
  2. Click Network tab
  3. Refresh page
  4. Look for request to affrank.io/script/...
  5. Should show Status: 200

Check in Dashboard

  1. Go to Domain Management
  2. Find your domain
  3. 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:

  1. Copy fresh script from dashboard
  2. Clear browser cache (Ctrl+Shift+Del)
  3. Try incognito window
  4. Verify internet connection
  5. Try different browser

Console shows error

Common errors:

ErrorSolution
404 Not FoundUser ID is wrong, copy from dashboard
Refused to executeScript blocked by extension/firewall
Uncaught SyntaxErrorScript corrupted, re-copy from dashboard
CORS errorBrowser 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

PlatformSupportMethod
WordPress✅ FullPlugin or manual
Shopify✅ FullSettings
Wix✅ FullCustom Code
Squarespace✅ FullCode Injection
Webflow✅ FullCustom Code
Ghost✅ FullCode Injection
Blogger✅ FullEdit HTML
HTML/Static✅ FullDirect edit
Google Sites✅ FullEmbed code
Drupal✅ FullGTM or custom
Joomla✅ FullModule/plugin

Advanced: Multiple Domains

To track multiple websites with one account:

  1. Generate one script (same ID)
  2. Install on all websites
  3. Each domain auto-identified by referer
  4. All domains in one dashboard
  5. 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

Next Steps