Skip to content

Send events from anything that can make an HTTP request

Use the DataVisitors HTTP API to send server events and query aggregate reports. Separate ingest and read keys control project access.

POST/api/eventCollect
Shell
curl -X POST https://api.datavisitors.com/api/event \  -H "Authorization: Bearer YOUR-INGEST-KEY" \  -H "Content-Type: application/json" \  -d '{"events":[{"event_name":"subscription_renewed", …}]}'# every field an event needs is in the manual

An ingest key sends events and reads nothing. This outline omits required event fields. Read the complete request.

POST/api/v1/queryRead
Shell
curl -X POST https://api.datavisitors.com/api/v1/query \  -H "Authorization: Bearer YOUR-READ-KEY" \  -H "Content-Type: application/json" \  -d '{"range":"7d","metric":"headline"}'

A read key reads aggregates and cannot send events. Read the complete request.

What a browser never sees

The moments that happen with nobody on the page.

Send these events from your server. Each event needs a project key, an event name and the required envelope fields.

Subscription renewed

Your billing system confirmed the payment. Nobody opened a page.

Background job finished

An export completed four hours after the visit ended.

Payment webhook arrived

Your provider told your server the charge cleared.

Purchase confirmed later

The tab closed before the confirmation arrived.

One journey, two sources

Use the same visitor identity when the privacy settings permit it. A new identity starts a separate journey.

Read the identity guide →

Read it back as data

Use your reports in your own tools.

Query aggregate reports for one project over a chosen range. The read key selects the project. The request does not need a project ID.

200 OKapplication/json Sample data
JSON
{    "range": "7d",    "metric": "headline",    "data": {        "Pageviews": 54120,        "Visitors": 19648,        "Sessions": 23516,        "Events": 61538    }}

Illustrative counts. The headline response contains totals, with no list of individual visitors.

What the Query API answers

Traffic

Visitors, page views, sessions and events

Pages

Landing pages, exit pages and page paths

Sources

Channels, referrers and campaigns

Events

Counts for your custom event names

Journeys

The paths visitors follow through your site

Scoped keys

The key controls what each request can do.

Create keys per project. Rotate or revoke each key separately. An ingest key cannot read a report.

Key scope Send events Read aggregates Manage the project Another project
ingest · Collect only Yes No No No
read · Report reads only No Yes No No
manage · Selected abilities only No No Yes No

Set allowed origins first

Name the domains permitted to send from a browser. Give servers a separate sending key.

Choose privacy settings first

Decide what to keep before the first event.

Rotate and revoke separately

Replacing an ingest key does not change the read key for your reports.

What to expect

Send one event. Confirm it arrived. Then build on it.

Verify one goal before a report depends on it. The manual documents the request, its answer and each error.

  1. An OpenAPI description

    The Query API publishes a schema for client generation.

    /docs/api
  2. A worked request in the manual

    The event guide includes the complete envelope and a response.

    /docs/http-api
  3. Confirm the first event

    Check the project status after you send your first event.

  4. Verify one goal

    Check that the goal counts the action you intend to measure.

A tracker is still the right tool for a website.

Use the browser tracker for navigation and engagement. Use the API for activity the browser cannot see, and to read results.

Browser tracker

Next step

Start measuring your product.

Join the waitlist. When we invite you, connect a site, app, or server and start reading.