Installation
Get PennyLens running on your site in two minutes.
Option 1: Script Tag (recommended for most sites)
Paste this snippet into the <head> of your site. Replace YOUR_SITE_ID with the ID from your project settings.
<script
src="https://cdn.pennylens.com/tracker.js"
data-site-id="YOUR_SITE_ID"
async
></script>
That's it. PennyLens starts tracking pageviews, clicks, scroll, and form interactions automatically.
Option 2: npm (for SPAs and custom setups)
npm install @pennylens/tracker
Initialize the tracker in your app entry point:
import { init } from "@pennylens/tracker";
init({
siteId: "YOUR_SITE_ID",
// Optional: tune session recording, privacy, etc.
});
Verify
- Open your site in a browser.
- Go to the PennyLens dashboard.
- Navigate to Overview — you should see a live pageview appear within 10 seconds.
If you don't see events after 30 seconds, check your browser console for errors and confirm the data-site-id matches your project.
Next steps
- Event Tracking — custom events, user identification, privacy controls
- API Reference — complete data model reference