Skip to content

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.

8 min read

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:

Node.js
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);
}

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

FreeStartProEnterprise
Events50K per month per organization50K per month per project100K per month per projectCustom
Additional eventsNot available$3 per 100K events$3 per 100K eventsCustom
Properties1 per projectUnlimitedUnlimitedUnlimited
Data retention30 days90 days90 daysCustom

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:

  1. In the Appwrite Console, open your project and go to Analytics.
  2. Select Create property, and enter a Name.
  3. Under Type, select Web, Mobile, or Agent. The type decides which cards the dashboard shows.
  4. For a website, enter its Domain.
  5. 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:

HTML
<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:

Web
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();

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:

Web
tracking.track('signup_completed', {
    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.

Read next