Introducing Appwrite Analytics for your websites, apps, and AI agents
See the people and the AI agents that visit your websites and apps, track the events that matter to your product, and block unwanted traffic with Firewall, all without cookies.

Your websites and apps get two kinds of visitors: people, and the bots and AI agents that read your pages. Appwrite Analytics shows you both. It counts the people who visit, where they come from, and what they do, and it names the crawlers and assistants that fetch your pages, from GPTBot to ChatGPT User.
Appwrite Analytics is built into Appwrite Cloud, next to the rest of your backend. It works without cookies, records the actions that matter to your product next to pageviews and screen views, and connects to Auth, Sites, and Firewall in the same project.
Why we built Appwrite Analytics
Analytics often lives in a separate tool, with its own script and its own account, away from the backend that knows your users and serves your pages. Tying a jump in traffic to the users behind it, or to the bots worth blocking, then means moving between products.
Appwrite Analytics brings that data into your project. A visitor on the dashboard can be a signed-in user in Auth, a page served by Appwrite Sites, or a bot that one Firewall rule can block. The goal is one place to see who uses your product, what they do there, and what reads your pages.
Properties and dashboards
Each website, app, or AI agent that you track is a property with its own dashboard. The dashboard answers questions such as:
- Where do visitors come from, including people who follow a link from ChatGPT or another AI assistant?
- Which pages and screens do people view, and where do they leave?
- How much of the traffic is bots, and which AI crawlers read your pages?
- How many people sign up, buy, or invite a teammate, and who are they?
- Which signed-in users are the most active?
Websites, apps, and AI agents
A property's type decides what its dashboard shows. A Web property counts visitors, pageviews, bounce rate, and the pages people enter and leave on. A Mobile property uses app terms, such as active users, sessions, and screen views, and adds installs, updates, and push notifications. An Agent property follows an AI agent of your own, with its events, visits, and the models and tools it calls.
Websites track with one script tag or the Web SDK, and sites on Appwrite Sites with one switch. Apps use the Tracking class in the Flutter, Android, Apple, and React Native SDKs, and servers send events with an API key.
See every visit on one dashboard
Each property has its own dashboard. The top row shows unique visitors, visits, pageviews, events, views per visit, bounce rate, visit duration, and engagement time for any date range, compared with the previous period. Add note marks a release or a campaign on the chart.
Below the chart, cards break your traffic down by page, location, browser, operating system, device, and version. Select any value to filter the dashboard to it, and combine filters to narrow it further. Export downloads the current view as a PDF report or as CSV files, to share the numbers with people who do not use Appwrite.
See the people and the agents that visit
Traffic sources shows how people found you: by channel, by referring site, and by UTM campaign. The ai channel counts the people who followed a link from an AI assistant, such as ChatGPT, to your site.
Humans vs bots shows how much of your traffic is automated, split into categories such as AI crawlers, AI assistants, search crawlers, social previews, and datacenter traffic. The AI agents and crawlers card names each bot, such as GPTBot, ClaudeBot, and ChatGPT User. Select Humans or Bots to filter the whole dashboard.
Track the events that matter
Custom events record what people do, such as a signup, a purchase, or an invite, with details such as the plan attached as props. Send them from the browser, from your app, or from your server with an API key. A server event that carries the visitor's IP address and user agent counts toward the same visitor as their browser events.
Select an event in the Custom events card to see who triggered it: Unique visitors and Visits then count the people and visits behind the event, and the cards show where it happened. The Event properties card breaks down the details attached to each event, such as the plan of a signup.
Know your signed-in users
Turn on Identify signed-in users in a property's settings, and every event from a signed-in session carries the user's ID from Auth. The Users card then lists your most active users, and a signed-in user on several devices counts as one visitor that day.
Each user in Auth also gets an Analytics tab, with their events per day, their active days, and the properties they used. Appwrite records only the user ID, never an email or a name.
Analytics for your Appwrite Sites
A site on Appwrite Sites needs no tracking code. Turn on Enable analytics when creating the site, or Web analytics in its settings, and Appwrite adds the tracker to every page on the site's production domains. The tracker sends its events through the site's own domain.
The site's Overview tab then shows an Analytics card with the last 24 hours of visitors, pageviews, bounce rate, visit duration, and top sources, with a link to the full dashboard.
Block unwanted traffic with Firewall
When a property tracks a site on Appwrite Sites, the dashboard is also the starting point for Firewall rules. Right-click a bot, a page, a hostname, or a location, and select Create firewall rule. For a country, the same menu offers Block this country and Allow only this country.
Check the impact before blocking
The rule opens for the site, with the condition and the Deny action filled in. Estimated impact shows how many of the site's recent requests the rule would have matched, and their share of the site's traffic. To check that a visitor is a person instead of denying every request, change the action to Challenge. Once created, the rule appears on the site's Firewall tab.
Read metrics from your code
listMetrics returns the numbers behind the dashboard: totals, a time series, or a breakdown by one dimension. Use it to build reports, send weekly summaries, or show statistics in your own app. This example lists the five countries with the most visitors in the last seven days, with an API key that has the analytics.read scope:
import { Client, Analytics, AnalyticsDimension } from 'node-appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<API_KEY>');
const analytics = new Analytics(client);
const countries = await analytics.listMetrics({
propertyId: '<PROPERTY_ID>',
dimensions: [AnalyticsDimension.Country],
dateRange: '7d',
limit: 5,
});
for (const row of countries.metrics) {
console.log(row.value, row.visitors);
}
import { Client, Analytics, AnalyticsDimension } from 'npm:node-appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<API_KEY>');
const analytics = new Analytics(client);
const countries = await analytics.listMetrics({
propertyId: '<PROPERTY_ID>',
dimensions: [AnalyticsDimension.Country],
dateRange: '7d',
limit: 5,
});
for (const row of countries.metrics) {
console.log(row.value, row.visitors);
}
<?php
require 'vendor/autoload.php';
use Appwrite\Client;
use Appwrite\Enums\AnalyticsDimension;
use Appwrite\Services\Analytics;
$client = (new Client())
->setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
->setProject('<PROJECT_ID>')
->setKey('<API_KEY>');
$analytics = new Analytics($client);
$countries = $analytics->listMetrics(
propertyId: '<PROPERTY_ID>',
dimensions: [AnalyticsDimension::COUNTRY()],
dateRange: '7d',
limit: 5,
);
foreach ($countries->metrics as $row) {
echo $row->value, ' ', $row->visitors, PHP_EOL;
}
from appwrite.client import Client
from appwrite.enums.analytics_dimension import AnalyticsDimension
from appwrite.services.analytics import Analytics
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1')
client.set_project('<PROJECT_ID>')
client.set_key('<API_KEY>')
analytics = Analytics(client)
countries = analytics.list_metrics(
property_id='<PROPERTY_ID>',
dimensions=[AnalyticsDimension.COUNTRY],
date_range='7d',
limit=5,
)
for row in countries.metrics:
print(row.value, row.visitors)
require 'appwrite'
include Appwrite
include Appwrite::Enums
client = Client.new
.set_endpoint('https://<REGION>.cloud.appwrite.io/v1')
.set_project('<PROJECT_ID>')
.set_key('<API_KEY>')
analytics = Analytics.new(client)
countries = analytics.list_metrics(
property_id: '<PROPERTY_ID>',
dimensions: [AnalyticsDimension::COUNTRY],
date_range: '7d',
limit: 5
)
countries.metrics.each do |row|
puts "#{row.value} #{row.visitors}"
end
using Appwrite;
using Appwrite.Enums;
using Appwrite.Services;
var client = new Client()
.SetEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.SetProject("<PROJECT_ID>")
.SetKey("<API_KEY>");
var analytics = new Analytics(client);
var countries = await analytics.ListMetrics(
propertyId: "<PROPERTY_ID>",
dimensions: new List<AnalyticsDimension> { AnalyticsDimension.Country },
dateRange: "7d",
limit: 5
);
foreach (var row in countries.Metrics)
{
Console.WriteLine($"{row.Value} {row.Visitors}");
}
import 'package:dart_appwrite/dart_appwrite.dart';
import 'package:dart_appwrite/enums.dart' as enums;
Future<void> main() async {
final client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setKey('<API_KEY>');
final analytics = Analytics(client);
final countries = await analytics.listMetrics(
propertyId: '<PROPERTY_ID>',
dimensions: [enums.AnalyticsDimension.country],
dateRange: '7d',
limit: 5,
);
for (final row in countries.metrics) {
print('${row.value} ${row.visitors}');
}
}
import io.appwrite.Client
import io.appwrite.enums.AnalyticsDimension
import io.appwrite.services.Analytics
suspend fun main() {
val client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
.setKey("<API_KEY>")
val analytics = Analytics(client)
val countries = analytics.listMetrics(
propertyId = "<PROPERTY_ID>",
dimensions = listOf(AnalyticsDimension.COUNTRY),
dateRange = "7d",
limit = 5,
)
for (row in countries.metrics) {
println("${row.value} ${row.visitors}")
}
}
import Appwrite
import AppwriteEnums
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
.setKey("<API_KEY>")
let analytics = Analytics(client)
let countries = try await analytics.listMetrics(
propertyId: "<PROPERTY_ID>",
dimensions: [.country],
dateRange: "7d",
limit: 5
)
for row in countries.metrics {
print(row.value ?? "", row.visitors)
}
package main
import (
"fmt"
"log"
"github.com/appwrite/sdk-for-go/v7/appwrite"
)
func main() {
client := appwrite.NewClient(
appwrite.WithEndpoint("https://<REGION>.cloud.appwrite.io/v1"),
appwrite.WithProject("<PROJECT_ID>"),
appwrite.WithKey("<API_KEY>"),
)
analytics := appwrite.NewAnalytics(client)
countries, err := analytics.ListMetrics(
"<PROPERTY_ID>",
analytics.WithListMetricsDimensions([]string{"country"}),
analytics.WithListMetricsDateRange("7d"),
analytics.WithListMetricsLimit(5),
)
if err != nil {
log.Fatal(err)
}
for _, row := range countries.Metrics {
fmt.Println(*row.Value, row.Visitors)
}
}
use appwrite::Client;
use appwrite::enums::AnalyticsDimension;
use appwrite::services::Analytics;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
client.set_endpoint("https://<REGION>.cloud.appwrite.io/v1");
client.set_project("<PROJECT_ID>");
client.set_key("<API_KEY>");
let analytics = Analytics::new(&client);
let countries = analytics.list_metrics(
"<PROPERTY_ID>",
None, // queries
None, // interval
Some(vec![AnalyticsDimension::Country]),
None, // prop_key
Some("7d"),
None, // start_at
None, // end_at
Some(5),
None, // total
).await?;
for row in countries.metrics {
println!("{} {}", row.value.unwrap_or_default(), row.visitors);
}
Ok(())
}
appwrite client \
--endpoint https://<REGION>.cloud.appwrite.io/v1 \
--project-id '<PROJECT_ID>' \
--key '<API_KEY>'
appwrite analytics list-metrics \
--property-id '<PROPERTY_ID>' \
--dimensions country \
--date-range 7d \
--limit 5
curl -G 'https://<REGION>.cloud.appwrite.io/v1/analytics/properties/<PROPERTY_ID>/metrics' \
-H 'X-Appwrite-Project: <PROJECT_ID>' \
-H 'X-Appwrite-Key: <API_KEY>' \
--data-urlencode 'dimensions[]=country' \
--data-urlencode 'dateRange=7d' \
--data-urlencode 'limit=5'
Privacy without cookies
Appwrite Analytics sets no cookies, and the Tracking class keeps no identifiers on the device. Appwrite identifies each visitor with a one-way hash of the IP address, the user agent, the hostname, and a salt that changes every day, so a returning visitor counts once per day. Appwrite uses the IP address to find the location and to compute the hash, and then discards it.
By default, the Web SDK sends no events for visitors who turn on Do Not Track in their browser, or from automated browsers. Keep personal data, such as names and email addresses, out of event names, props, and URLs. The privacy documentation lists everything that Appwrite stores for each event.
Pricing and limits
| Free | Start | Pro | Enterprise | |
|---|---|---|---|---|
| Events | 50K per month per organization | 50K per month per project | 100K per month per project | Custom |
| Additional events | Not available | $3 per 100K events | $3 per 100K events | Custom |
| Properties | 1 per project | Unlimited | Unlimited | Unlimited |
| Data retention | 30 days | 90 days | 90 days | Custom |
On the Free plan, the events limit covers every property in the organization. On Start and Pro, each project has its own limit. Every limit includes the automatic events that Tracking sends, and traffic from datacenter networks and Firebase Test Lab devices doesn't count toward it. For the full details, see Limits and retention.
Get started
Setting up Analytics takes three steps: create a property, add tracking to your site or app, and send your first custom event.
Create a property
Appwrite accepts events only from the websites and apps registered under Apps in your project, so register yours first. Then create the property:
- In the Appwrite Console, open your project and go to Analytics.
- Select Create property, and enter a Name.
- Under Type, select Web, Mobile, or Agent. The type decides which cards the dashboard shows.
- For a website, enter its Domain.
- Under SDK, pick the platform whose install code the Console shows next, and select Create property.
The Console then shows the install steps, with your endpoint, project ID, and property ID filled in. The Set up with AI card has a ready-made prompt for your AI coding tool, and the page confirms the first event when it arrives.
Add tracking
A site on Appwrite Sites needs no script tag or SDK. Turn on Web analytics in the site's Settings tab, and Appwrite adds the tracker to every page on the site's production domains.
On any other website, one script tag tracks pageviews, outbound links, scroll depth, and engagement time. Add it to the <head> of every page:
<script defer src="https://sdk.appwrite.io/web/29.4.0/tracker.js"
data-endpoint="https://<REGION>.cloud.appwrite.io/v1"
data-project="<PROJECT_ID>"
data-property="<PROPERTY_ID>"></script>
In an app with a build step, and in mobile apps, install the Appwrite SDK for your platform and call start() on its Tracking class. In a mobile app, start() records installs and time in the app, and screenView() records each screen:
import { Client, Analytics, Tracking } from 'appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>');
const tracking = new Tracking(new Analytics(client), '<PROPERTY_ID>');
tracking.start();
import 'package:appwrite/appwrite.dart';
import 'package:flutter/material.dart';
final client = Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>');
final tracking = Tracking(Analytics(client), '<PROPERTY_ID>');
void main() {
tracking.start();
runApp(
MaterialApp(
navigatorObservers: [TrackingObserver(tracking)],
home: const HomeScreen(),
),
);
}
import io.appwrite.Client
import io.appwrite.Tracking
import io.appwrite.services.Analytics
// In Application.onCreate()
val client = Client(this)
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
val tracking = Tracking(Analytics(client), "<PROPERTY_ID>")
tracking.start()
import Appwrite
let client = Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1")
.setProject("<PROJECT_ID>")
let tracking = Tracking(Analytics(client), propertyId: "<PROPERTY_ID>")
tracking.start()
import 'react-native-url-polyfill/auto';
import { Analytics, Client, Tracking } from 'react-native-appwrite';
const client = new Client()
.setEndpoint('https://<REGION>.cloud.appwrite.io/v1')
.setProject('<PROJECT_ID>')
.setPlatform('com.example.acmestore');
const tracking = new Tracking(new Analytics(client), '<PROPERTY_ID>');
tracking.start();
Send a custom event
Call the tracker where the action completes, such as after a signup succeeds. A server uses an API key with the analytics.write scope and passes the visitor's ip and userAgent:
tracking.track('signup_completed', {
props: { plan: 'pro', source: 'pricing_page' },
});
tracking.event(
'signup_completed',
url: '/signup',
props: {'plan': 'pro', 'source': 'pricing_page'},
);
tracking.event(
"signup_completed",
url = "/signup",
props = mapOf("plan" to "pro", "source" to "pricing_page"),
)
tracking.event("signup_completed", url: "/signup", props: ["plan": "pro", "source": "pricing_page"])
tracking.track('signup_completed', {
url: '/signup',
props: { plan: 'pro', source: 'pricing_page' },
});
await analytics.createEvent({
propertyId: '<PROPERTY_ID>',
name: 'signup_completed',
url: 'https://example.com/signup',
ip: '<VISITOR_IP>',
userAgent: '<VISITOR_USER_AGENT>',
props: ['plan', 'pro', 'source', 'pricing_page'],
});
await analytics.createEvent({
propertyId: '<PROPERTY_ID>',
name: 'signup_completed',
url: 'https://example.com/signup',
ip: '<VISITOR_IP>',
userAgent: '<VISITOR_USER_AGENT>',
props: ['plan', 'pro', 'source', 'pricing_page'],
});
$analytics->createEvent(
propertyId: '<PROPERTY_ID>',
name: 'signup_completed',
url: 'https://example.com/signup',
ip: '<VISITOR_IP>',
userAgent: '<VISITOR_USER_AGENT>',
props: ['plan', 'pro', 'source', 'pricing_page'],
);
analytics.create_event(
property_id='<PROPERTY_ID>',
name='signup_completed',
url='https://example.com/signup',
ip='<VISITOR_IP>',
user_agent='<VISITOR_USER_AGENT>',
props=['plan', 'pro', 'source', 'pricing_page'],
)
analytics.create_event(
property_id: '<PROPERTY_ID>',
name: 'signup_completed',
url: 'https://example.com/signup',
ip: '<VISITOR_IP>',
user_agent: '<VISITOR_USER_AGENT>',
props: ['plan', 'pro', 'source', 'pricing_page']
)
await analytics.CreateEvent(
propertyId: "<PROPERTY_ID>",
name: "signup_completed",
url: "https://example.com/signup",
ip: "<VISITOR_IP>",
userAgent: "<VISITOR_USER_AGENT>",
props: new List<string> { "plan", "pro", "source", "pricing_page" }
);
await analytics.createEvent(
propertyId: '<PROPERTY_ID>',
name: 'signup_completed',
url: 'https://example.com/signup',
ip: '<VISITOR_IP>',
userAgent: '<VISITOR_USER_AGENT>',
props: ['plan', 'pro', 'source', 'pricing_page'],
);
analytics.createEvent(
propertyId = "<PROPERTY_ID>",
name = "signup_completed",
url = "https://example.com/signup",
ip = "<VISITOR_IP>",
userAgent = "<VISITOR_USER_AGENT>",
props = listOf("plan", "pro", "source", "pricing_page"),
)
_ = try await analytics.createEvent(
propertyId: "<PROPERTY_ID>",
name: "signup_completed",
url: "https://example.com/signup",
props: ["plan", "pro", "source", "pricing_page"],
ip: "<VISITOR_IP>",
userAgent: "<VISITOR_USER_AGENT>"
)
_, err := analytics.CreateEvent(
"<PROPERTY_ID>",
"signup_completed",
"https://example.com/signup",
analytics.WithCreateEventIp("<VISITOR_IP>"),
analytics.WithCreateEventUserAgent("<VISITOR_USER_AGENT>"),
analytics.WithCreateEventProps([]string{"plan", "pro", "source", "pricing_page"}),
)
if err != nil {
log.Fatal(err)
}
analytics.create_event(
"<PROPERTY_ID>",
"signup_completed",
"https://example.com/signup",
None, // domain
None, // referrer
None, // screen_width
None, // session_hash
None, // scroll_depth
None, // engagement_time
Some(vec!["plan".into(), "pro".into(), "source".into(), "pricing_page".into()]),
None, // user_id
Some("<VISITOR_IP>"),
Some("<VISITOR_USER_AGENT>"),
None, // interactive
).await?;
appwrite analytics create-event \
--property-id '<PROPERTY_ID>' \
--name signup_completed \
--url https://example.com/signup \
--ip '<VISITOR_IP>' \
--user-agent '<VISITOR_USER_AGENT>' \
--props plan --props pro --props source --props pricing_page
curl -X POST 'https://<REGION>.cloud.appwrite.io/v1/analytics/properties/<PROPERTY_ID>/events' \
-H 'Content-Type: application/json' \
-H 'X-Appwrite-Project: <PROJECT_ID>' \
-H 'X-Appwrite-Key: <API_KEY>' \
-d '{
"name": "signup_completed",
"url": "https://example.com/signup",
"ip": "<VISITOR_IP>",
"userAgent": "<VISITOR_USER_AGENT>",
"props": ["plan", "pro", "source", "pricing_page"]
}'
Then open the property's dashboard and select the event in the Custom events card.
Conclusion
Knowing who visits, what they do, and which AI agents read your pages used to take another tool and another account. Appwrite Analytics keeps that data in the same project as your users, your sites, and your Firewall rules, so a jump in traffic leads straight to the people behind it, or to the bot worth blocking.
We'd love to hear what turns up on your dashboard, so share it or ask a question on Discord.
Resources
Appwrite Analytics is the analytics product of Appwrite Cloud. It shows who visits your websites and apps, where they come from, which pages and screens they view, and which events they trigger. It also labels traffic from bots and AI agents, and it works without cookies.
No. Appwrite Analytics sets no cookies and keeps no identifiers on the visitor's device. Each visitor ID is a one-way hash of the IP address, the user agent, the hostname, and a salt that changes every day, so a returning visitor counts once per day. Appwrite does not store the IP address.
Appwrite labels bots by their user agent, their referrer, and the network they come from, and records each bot's name and category, such as AI crawler or AI assistant. People who follow a link from an AI assistant to your site are not bots: they count as visitors in the ai channel.
Use the tracker script on websites, the Web analytics switch on Appwrite Sites, or the Tracking class in the Web, Flutter, Android, Apple, and React Native SDKs. Servers send events with a server SDK and an API key.
Yes, for sites hosted on Appwrite Sites. Right-click the bot on the dashboard and select Create firewall rule. The rule opens with Deny selected and shows its estimated impact before it's created.
The Free plan includes 50K events per month for the organization, with 30 days of retention. The Start and Pro plans include 50K and 100K events per month for each project, then $3 per 100K events, with 90 days of retention. Traffic from datacenter networks and Firebase Test Lab devices does not count toward the limit.





