Prerequisites
- Your Permutive Workspace API Key, Workspace ID, and Organization ID (from your dashboard)
- Access to edit your website’s HTML or tag manager
Step 1: Add the SDK
Add the following code to the<head> section of your page, as early as possible. This ensures the SDK loads before other scripts and can queue events immediately.
<WORKSPACE_API_KEY>, <WORKSPACE_ID>, and <ORGANIZATION_ID> with your credentials from the Permutive dashboard.
Queue-Based Loading: The SDK uses a queue-based pattern. You can call SDK methods immediately - they’re queued and executed once the SDK loads.
Step 2: Initialize the Web Addon
The web addon provides automatic pageview tracking, engagement measurement, and more. Add this code after the SDK script:Step 3: Complete Example
Here’s a complete example with the SDK, web addon, and page properties:Step 4: Verify the Integration
-
Enable Debug Mode: Add
?__permutive.loggingEnabled=trueto your page URL - Open Developer Console: Press F12 or right-click and select “Inspect”, then go to the Console tab
-
Look for SDK Messages: You should see messages like:
-
Check localStorage: In Developer Tools, go to Application > Local Storage and look for keys starting with
permutive-or_p
What Happens Automatically
With the web addon configured, the SDK automatically:- Tracks Pageview events when the page loads
- Measures engagement time (PageviewEngagement events)
- Tracks page completion (PageviewComplete when user leaves)
- Captures form submissions (FormSubmission events)
- Records link clicks (LinkClick events for outbound links)
Next Steps
Installation Details
Tag manager options
Initialization Options
Advanced SDK configuration
Pageview Tracking
Customize pageview tracking
Identity Management
Track users across sessions