Phi SDK v2.1
One script.
Full intelligence.
Add analytics, chat, and user identification to any website. Lightweight, privacy-first, and cookie-free.
Single script, no dependenciesNo cookies by defaultReal-time data
Quick Start
1. Add the script
html
<script
src="https://phi.llc/phi.js"
data-id="YOUR_SITE_ID"
></script>Add this before the closing </body> tag. Get your site ID from the dashboard.
2. Enable features
html
<script
src="https://phi.llc/phi.js"
data-id="YOUR_SITE_ID"
data-chat="true"
data-track-clicks="true"
data-scroll-depth="true"
></script>Enable chat widget, click tracking, scroll depth, and more with data attributes.
Features
Real-Time Analytics
Pageviews, sessions, visitors, and custom events
Built-in Chat
Live chat widget with AI-powered responses
User Identification
Link anonymous visitors to known users
QR Tracking
Generate and track QR codes with UTM params
JavaScript API
phi.identify()
Link the current visitor to a known user. This enables cross-session tracking and personalization.
javascript
// Identify logged-in users
phi.identify({
email: 'user@example.com',
name: 'Jane Doe',
plan: 'premium'
});phi.track()
Track custom events with optional properties. Events appear in real-time on your dashboard.
javascript
// Track custom events
phi.track('purchase', {
amount: 99.00,
currency: 'USD',
product: 'Premium Plan'
});
// Track form submissions
phi.track('form_submit', {
form_name: 'contact',
email: formData.email
});Configuration Options
| Attribute | Type | Description |
|---|---|---|
data-id* | string | Your site ID (required) |
data-chat | boolean | Enable chat widget |
data-chat-theme | 'dark' | 'light' | Chat widget theme |
data-track-clicks | boolean | Track all click events |
data-scroll-depth | boolean | Track scroll depth |
data-outbound-links | boolean | Track outbound link clicks |
data-web-vitals | boolean | Track Core Web Vitals |
data-honor-dnt | boolean | Honor Do Not Track header |
data-debug | boolean | Enable debug logging |
Ready to get started?
Create a free account to get your site ID and start tracking.