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.
An ingest key sends events and reads nothing. This outline omits required event fields. Read the complete request.
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 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.
{ "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.
-
A worked request in the manual
The event guide includes the complete envelope and a response.
/docs/http-api -
Confirm the first event
Check the project status after you send your first event.
-
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.