@impressio/sdk Documentation

Multi-touch attribution SDK that installs a Service Worker on your domain to persist UTMs, click IDs, and campaign data throughout the user's entire browsing session.

🚀 Quick Start

1

Install

npm install @impressio/sdk
2

Copy Service Worker

# Next.js, Vite, CRA — copy to your public directory
cp node_modules/@impressio/sdk/dist/service-worker.js public/service-worker.js
Important: The Service Worker must be served from your domain root (/service-worker.js) for full scope coverage.
3

Include the Loader

// Option A: Script tag (simplest)
<script src="node_modules/@impressio/sdk/dist/loader.js"></script>

// Option B: ESM import
import '@impressio/sdk';

// Option C: CommonJS
require('@impressio/sdk');
That's it! The SDK automatically registers the Service Worker, detects traffic sources on every navigation, and exposes the data via window.TrafficCampaign.

⚙️ Configuration

<script
  src="/path/to/loader.js"
  data-debug="true"        // Enable console logging
  data-branding="false"     // Disable branding
  data-sw-timeout="5000"    // SW response timeout (ms)
  data-max-retries="2"      // Retry count
></script>
AttributeDefaultDescription
data-debugfalseEnable debug logging in console
data-brandingtrueShow Impressio branding in console
data-sw-timeout5000Timeout for SW response (ms)
data-max-retries2Number of retries on failure

📚 Documentation

🖥️ Client-Side Scripts

4 JavaScript engines served as a single bundle via Lambda@Edge. Comprehensive documentation for each: