Installation Methods
- Script Tag (Recommended)
- Google Tag Manager
- Other Tag Managers
The script tag method is the recommended approach for most websites. It provides the fastest load time and simplest setup.Replace:
Basic Installation
Add to the<head> section of your page, as early as possible:<WORKSPACE_API_KEY>- Your public API key<WORKSPACE_ID>- Your workspace ID<ORGANIZATION_ID>- Your organization ID
With Configuration Options
Pass configuration options as the fourth argument:Understanding the Loader Script
The inline loader script (the first<script> block) does the following:
- Creates the global
permutiveobject if it doesn’t exist - Initializes a queue (
permutive.q) to store method calls before the SDK loads - Sets configuration including API key and workspace ID
- Creates stub methods (
track,identify, etc.) that add calls to the queue
SDK Source Files
The SDK is served from your organization’s edge CDN:The SDK is served from Permutive’s edge CDN with appropriate caching headers. It typically loads in under 100ms on modern connections.
Load Order Best Practices
1
Load Permutive First
Place the Permutive script tag before other third-party scripts, especially before ad scripts.
2
Use Async Loading
The
async attribute on the live.js script allows parallel loading without blocking page render.3
Initialize Web Addon Early
Call
permutive.addon('web', {...}) immediately after the SDK script to capture the pageview event early.4
Configure Consent Before Tracking
If using consent management, call
permutive.consent() before initializing the web addon if consentRequired: true.Verifying Installation
After installation, verify the SDK is loading correctly:- Add
?__permutive.loggingEnabled=trueto your URL - Open the browser console (F12 > Console)
- Look for
[Permutive]prefixed messages - Check Application > Local Storage for
permutive-*keys
Troubleshooting Installation
SDK not loading
SDK not loading
Symptoms: No
permutive object on window, no console messages.Solutions:- Verify the script URL is correct (
https://<ORGANIZATION_ID>.edge.permutive.app/<WORKSPACE_ID>-web.js) - Check for network errors in DevTools > Network tab
- Ensure the inline loader script runs before the SDK script
- Check for Content Security Policy (CSP) blocking the script
Methods not working
Methods not working
Symptoms: Calls to
permutive.track() or other methods don’t do anything.Solutions:- Verify API key and workspace ID are correct
- Check browser console for error messages
- Ensure the loader script created stub methods correctly
Script blocked by CSP
Script blocked by CSP
Symptoms: Console error about Content Security Policy, or network requests from the SDK fail with stack traces that start with The SDK creates a web worker from a
blob:.Solution: Add the Permutive domains and blob: to your CSP:blob: URL and sends network requests from that worker. If your CSP does not allow blob:, the browser blocks the worker or its requests.Tag manager timing issues
Tag manager timing issues
Symptoms: Events missing or SDK not initialized when other tags fire.Solutions:
- Set Permutive tag priority to highest (e.g., 9999 in GTM)
- Use
permutive.ready()in dependent tags to wait for SDK - Ensure trigger fires on “All Pages” before other triggers
Next Steps
Initialization
Configure SDK options
Verification
Verify your integration