Set Up AI Agent Analytics
Client-Side Analytics
Track the activity of all known AI agents intelligently navigating and interacting with your website autonomously, using a browser like a human would.
Important Note
This guide shows you how to set up client-side agent analytics. If you want to track crawlers and scrapers (which don't run JavaScript), you can also set up server-side analytics.
1. Create a New Project
Sign up and create a new project for your website if you haven't already.
- Navigate to the Projects page
- Click the New Project button
- Enter your website details
- Click Create
2. Start Sending Visit Events
There are 2 ways to send visit events from your website to your project.
Option 1: Use the JavaScript Tag
- Navigate to the Projects page
- Click on your project
- Click Settings
- Copy the JavaScript tag
- Paste it into the HTML
<head>
tag of your website's pages.
The JavaScript tag will look something like this, with the project key (which is different than your access token) pre-populated:
<script src="https://darkvisitors.com/tracker.js?project_key=PROJECT_KEY></script>
Option 2: Use the WordPress Plugin
Use this method for WordPress websites. Adding the plugin is quick and easy.
Copy Your Access Token
- Navigate to the Projects page
- Click on your project
- Click Settings
- Copy your access token
Install the Plugin
- Log in to your website's WordPress dashboard
- Click Plugins in the sidebar
- Search for "Dark Visitors" or download the plugin directly
- Click Install Now
- Click Activate
- Click Dark Visitors in the sidebar
- Paste your access token
- Click Save Changes
3. Test Your Integration
- Navigate to the Projects page
- Click on your project
- Click Settings
- Click Send a Test Visit
- Click realtime
If your website is correctly sending visit events to the project, you should see a new visit from the Dark Visitor agent in the project's realtime timeline.