PageLens Analytics
v1.0.0Cookieless web analytics and AI Visibility: traffic, funnels, errors, and which AI bots read you.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_sites
List the websites this key can access, with visitors in the last 24 hours.
list_segments
Saved segments (named filter sets such as "Paid traffic" or "Mobile in Germany") that can be applied to any report with segment_id.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
get_overview
Headline metrics (visitors, sessions, pageviews, pages per session, bounce rate, average session duration) for a period, compared with the previous period of the same length, plus a time series.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
include_series | boolean | Include the per-day/hour series (default true) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_breakdown
Top values of one dimension (pages, entry/exit pages, referrers, channels, UTM tags, countries, cities, browsers, OS, devices, languages, custom events, outbound links) with visitors and sessions.
| Parameter | Type | Description |
|---|---|---|
dimension * | string | |
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
search | string | Only values containing this text |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_pages
Per-page metrics: visitors, pageviews, entries, bounce rate and time on page.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_realtime
Visitors online right now (last 5 minutes) and what they are viewing.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
list_sessions
Recent sessions with entry/exit page, pages viewed, duration, source, location and device.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
kind | string | |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
user_id | string | Only sessions of this identified user |
get_session
Every pageview and event in one session, in order.
| Parameter | Type | Description |
|---|---|---|
session_id * | string | |
site_id * | string | Site id from list_sites |
get_events
Custom events (sent with pagelens.track) and outbound clicks with counts and their properties.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_errors
JavaScript errors grouped by message, with occurrences, affected sessions and pages.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_web_vitals
Core Web Vitals from real visitors (LCP, INP, CLS, FCP, TTFB) at p50/p75/p90, overall and per page.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_journeys
Most common page-to-page paths visitors take.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
run_funnel
Conversion funnel: how many sessions completed each step. Steps are pages (path, * wildcard allowed), custom event names, or a page scrolled at least `threshold` percent (type scroll). mode: ordered (default; other pages may come in between), strict (each step right after the previous one) or flexible (middle steps may be skipped). compare_previous adds the same funnel over the previous period.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
steps * | array | |
compare_previous | boolean | |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
mode | string | |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
list_goals
Goals with conversions and conversion rate for the period, compared with the previous period.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
create_goal
Create a goal that counts sessions visiting a page, firing a custom event, or scrolling a page at least `threshold` percent (type scroll). Needs a write key and member access or higher.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
type * | string | |
value * | string | Page path (wildcards allowed) or event name |
name | string | |
threshold | integer | For scroll goals: percentage of the page scrolled, e.g. 75 |
add_annotation
Mark a date on the charts (a release, a campaign, an outage). Needs a write key and member access or higher.
| Parameter | Type | Description |
|---|---|---|
date * | string | YYYY-MM-DD |
site_id * | string | Site id from list_sites |
text * | string |
get_retention
Cohort retention of identified users (pagelens.identify): share of each daily or weekly cohort that came back in later periods.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
unit | string |
list_users
Users active in the period: identified users (with traits) and anonymous visitors, with sessions, pageviews and first source.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
kind | string | |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
search | string | Match user id, name or email |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_user
Profile of one identified user (traits, first/last seen, totals) and their sessions.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
user_id * | string |
get_search_console
Google Search Console data for the site (when connected): clicks, impressions, CTR and average position in Google Search, by query, page, country or device, plus a daily series. Data lags about 2 days.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
dimension | string | |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
limit | integer | Rows to return (default 10) |
period | string | Time range (default 7d) |
search | string | Only queries (or pages) containing this text |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
delete_user_data
GDPR erasure: permanently delete all events, session replays and the profile of one user on a site. Needs a write key and admin access.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
user_id * | string | Identified user id, or "anon:<visitor_id>" for an anonymous visitor |
get_bots_and_ai
Bot and AI traffic: AI crawlers (GPTBot, ClaudeBot…), AI assistants fetching pages, search engines, and human visits referred by AI assistants (ChatGPT, Perplexity, Claude…).
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |
get_ai_visibility
How the site shows up in AI assistants, per AI company (OpenAI/ChatGPT, Anthropic/Claude, Perplexity, Google/Gemini…) and per page: crawler reads, live fetches while answering a person, human visits sent back, purchases and revenue, robots.txt access, and plain-language findings.
| Parameter | Type | Description |
|---|---|---|
site_id * | string | Site id from list_sites |
filters | array | Optional filters "dimension:value" (is). Other operators go after the dimension: "page!:/x" is not, "page~:blog" contains, "page!~:blog" does not contain, "page^:/docs" starts with. Dimensions: page,… |
from | string | Start date YYYY-MM-DD (overrides period) |
period | string | Time range (default 7d) |
segment_id | string | Apply a saved segment (see list_segments); combines with filters |
timezone | string | IANA timezone for days and hours, e.g. Europe/Berlin (default UTC) |
to | string | End date YYYY-MM-DD, inclusive (default today) |