Documentation
Everything you need to integrate Dwellcount into your website or application.
Quick Start
Script Tag
Fastest way to start
<script
src="https://cdn.dwellcount.com/tracker.js"
data-site-id="YOUR_SITE_ID"
defer
></script>NPM Package
For bundled apps
npm install @dwellcount/tracker
import { init } from '@dwellcount/tracker';
init({ siteId: 'YOUR_SITE_ID' });Documentation
Getting Started
Quick setup guide for adding Dwellcount to your website.
Frameworks
Integration guides for React, Vue, Svelte, Angular, and Node.js.
Server-Side
Track API performance and metrics from your Node.js backend.
Events & Logging
Custom events and structured logging for full-stack visibility.
Configuration
All configuration options and context presets explained.
Self-Hosting
Deploy Dwellcount on your own infrastructure.
API Reference
Complete API documentation for the tracker and REST API.
Best Practices
Tips for getting the most out of your analytics.
Self-Hosting Guide
Deploy Dwellcount on your own infrastructure with all features included. Requirements: 2GB RAM VPS, Docker, and a domain with HTTPS.
Quick Setup
# Clone the repository
git clone https://github.com/TheDecipherist/dwellcount.git
cd dwellcount
# Copy environment template
cp .env.example .env
# Edit .env with your settings
nano .env
# Start with Docker Compose
docker-compose up -dEnvironment Variables
# Required
MONGODB_URI=mongodb://localhost:27017
MONGO_DB_NAME=dwellcount
NEXTAUTH_SECRET=your-secret-key
NEXTAUTH_URL=https://analytics.yourdomain.com
# Optional
SMTP_HOST=smtp.example.com
SMTP_USER=your-email
SMTP_PASS=your-passwordAPI Reference
Tracker Methods
init(config)Initialize the trackertrack(event, data)Track custom eventidentify(userId, traits)Identify a usersetConsent(granted)Set tracking consent
REST API
POST /api/ingestIngest eventsGET /api/sessionsList sessionsGET /api/analytics/overviewGet analytics summaryGET /api/analytics/heatmapGet heatmap data