Installation
Learn how to install Deepns on your website using various methods.
Basic Installation
The simplest way to install Deepns is using our JavaScript snippet:
<script src="https://api.deepns.com/analytics.js" data-site-id="YOUR_SITE_ID"></script>
Add this to your website’s <head> section, ideally as early as possible for accurate tracking.
Installation Methods
Static HTML Websites
For static sites, add the snippet directly to your HTML:
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<script src="https://api.deepns.com/analytics.js" data-site-id="YOUR_SITE_ID"></script>
</head>
<body>
<!-- Your content -->
</body>
</html>
WordPress
- Install the Insert Headers and Footers plugin
- Go to Settings > Insert Headers and Footers
- Paste the Deepns snippet in the Header section
- Click Save
React Applications
Install via npm and import in your app:
npm install @deepns/react
import { DeepnsProvider } from '@deepns/react';
function App() {
return (
<DeepnsProvider siteId="YOUR_SITE_ID">
{/* Your app */}
</DeepnsProvider>
);
}
Vue.js Applications
npm install @deepns/vue
import { createApp } from 'vue';
import DeepnsPlugin from '@deepns/vue';
const app = createApp(App);
app.use(DeepnsPlugin, { siteId: 'YOUR_SITE_ID' });
Verification
After installation, verify tracking is working:
- Visit your website
- Check the browser console for
Deepns: Tracking initialized - Visit your Deepns dashboard to see live visitors
Configuration Options
The tracking script supports these optional attributes:
| Attribute | Description | Default |
|---|---|---|
data-site-id |
Your site ID (required) | - |
data-auto-track |
Enable automatic pageview tracking | true |
data-honor-dnt |
Respect Do Not Track browser setting | false |
Example with options:
<script
src="https://api.deepns.com/analytics.js"
data-site-id="YOUR_SITE_ID"
data-auto-track="true"
data-honor-dnt="true">
</script>
Troubleshooting
Script not loading?
- Check your site ID is correct
- Verify no ad blockers are interfering
- Check browser console for errors
No data appearing?
- Wait a few minutes for data to process
- Visit your site in an incognito window
- Ensure the script is in the
<head>section
Next Steps
- Set up Event Tracking
- Configure Custom Events
- Explore the API Reference