Netlify Integration
Automatically inject Entrolytics analytics into your Netlify sites
Netlify Integration
The @entro314labs/netlify-plugin-entrolytics automatically injects Entrolytics analytics into your Netlify sites during the build process.
Features
- ✅ Zero-config setup - Automatically injects tracking script into all HTML files
- ✅ Build-time injection - No runtime performance impact
- ✅ Static site support - Works with Hugo, Jekyll, Eleventy, Gatsby, Next.js (SSG), and more
- ✅ Cross-domain tracking - Configure multiple domains
- ✅ Privacy controls - Respect Do Not Track settings
- ✅ Smart detection - Skips files that already have the script
Quick Start
Install via Netlify UI
- Go to your Netlify site dashboard
- Navigate to Site settings → Build & deploy → Plugins
- Search for "Entrolytics"
- Click Install
Add Environment Variable
In your Netlify site settings:
- Go to Site settings → Environment variables
- Add
ENTROLYTICS_WEBSITE_IDwith your website ID - Optionally add
ENTROLYTICS_HOSTfor self-hosted instances
[[plugins]]
package = "@entro314labs/netlify-plugin-entrolytics"
[plugins.inputs]
websiteId = "your-website-id"
host = "https://cloud.entrolytics.click"Deploy Your Site
Trigger a new deploy. The plugin will inject the tracking script into all HTML files.
Installation Methods
Recommended for beginners
- Navigate to Plugins in your site settings
- Search for "Entrolytics"
- Click Install
- Configure via environment variables
Add to your netlify.toml file:
[[plugins]]
package = "@entro314labs/netlify-plugin-entrolytics"
[plugins.inputs]
websiteId = "abc123-def456"
host = "https://cloud.entrolytics.click"
autoTrack = trueCommit and push to deploy.
npm install -D @entro314labs/netlify-plugin-entrolyticsThen add to netlify.toml:
[[plugins]]
package = "@entro314labs/netlify-plugin-entrolytics"Configuration
Plugin Inputs
| Input | Type | Description | Default |
|---|---|---|---|
websiteId | string | Your Entrolytics website ID (required) | ENTROLYTICS_WEBSITE_ID env var |
host | string | Entrolytics host URL | https://cloud.entrolytics.click |
autoTrack | boolean | Automatically track page views | true |
respectDnt | boolean | Respect Do Not Track setting | false |
injectInHead | boolean | Inject in <head> vs before </body> | true |
domains | string | Comma-separated domains for cross-domain tracking | - |
Environment Variables
| Variable | Description |
|---|---|
ENTROLYTICS_WEBSITE_ID | Your Entrolytics website ID (required) |
ENTROLYTICS_HOST | Custom Entrolytics host URL (optional) |
ENTROLYTICS_DOMAINS | Cross-domain tracking domains (optional) |
Configuration Examples
How It Works
The plugin runs during the onPostBuild lifecycle hook:
Build Complete
Your static site generator finishes building all HTML files.
Plugin Activation
The Netlify plugin is triggered automatically.
Script Injection
The plugin:
- Scans the publish directory for all
.htmlfiles - Injects the Entrolytics tracking script with your configuration
- Skips files that already contain the script (prevents duplicates)
Deploy
Modified files are deployed to Netlify's CDN.
Supported Frameworks
This plugin works seamlessly with any static site generator:
| Framework | Status | Notes |
|---|---|---|
| Hugo | ✅ | Fully supported |
| Jekyll | ✅ | Fully supported |
| Eleventy | ✅ | Fully supported |
| Gatsby | ✅ | Static export mode |
| Next.js | ✅ | SSG/export mode |
| Astro | ✅ | Static builds |
| Docusaurus | ✅ | Fully supported |
| VuePress | ✅ | Fully supported |
| MkDocs | ✅ | Fully supported |
For SPAs
If you're building a single-page application that doesn't generate multiple HTML files, consider using our framework-specific packages instead:
@entro314labs/entro-nextjsfor Next.js@entro314labs/entro-reactfor React@entro314labs/entro-vuefor Vue@entro314labs/entro-sveltefor Svelte
Manual Event Tracking
After the plugin injects the script, track custom events in your JavaScript:
// Track a custom event
window.entrolytics?.track('button_click', {
button: 'signup',
location: 'header'
});
// Identify a user
window.entrolytics?.identify('user-123', {
email: 'user@example.com',
plan: 'pro'
});
// Track revenue
window.entrolytics?.track('purchase', {
revenue: 99.99,
currency: 'USD'
}, 99.99);Verification
Check Build Logs
In your Netlify build logs, look for:
Plugin "@entro314labs/netlify-plugin-entrolytics" installed
Entrolytics Analytics: Injected into 42 HTML filesVerify Script Injection
View the source of your deployed site and look for:
<script defer src="https://cloud.entrolytics.click/script.js"
data-website-id="your-website-id"></script>Check Dashboard
Visit your Entrolytics dashboard to see live traffic.
Troubleshooting
Local Development
The plugin only runs during Netlify builds. For local development:
Add the script tag to your HTML template:
<script
defer
src="https://cloud.entrolytics.click/script.js"
data-website-id="your-website-id"
></script>Use a framework-specific SDK for better DX:
npm install @entro314labs/entro-reactSee SDK documentation for setup.
Migration from Manual Script
If you're currently using a manual script tag:
Remove Manual Script
Remove the Entrolytics script from your HTML templates.
Install Plugin
Add the plugin to netlify.toml or via the Netlify UI.
Deploy
The plugin will automatically inject the script during build.
Environment-Specific Configuration
Use different Website IDs for production and preview:
[[plugins]]
package = "@entro314labs/netlify-plugin-entrolytics"
[plugins.inputs]
websiteId = "${ENTROLYTICS_WEBSITE_ID}"Then set different environment variables:
- Production:
ENTROLYTICS_WEBSITE_ID=prod-id - Preview:
ENTROLYTICS_WEBSITE_ID=staging-id
Support
- Documentation: docs.entrolytics.click
- GitHub Issues: netlify-plugin-entrolytics
- Email: hey@entrolytics.click