PageLens Analytics

v1.0.0
io.pagelens/pagelens Checked 4 days ago Published 1 month ago

Cookieless 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.

ParameterTypeDescription
site_id *stringSite 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
include_seriesbooleanInclude the per-day/hour series (default true)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
dimension *string
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
searchstringOnly values containing this text
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

get_pages

Per-page metrics: visitors, pageviews, entries, bounce rate and time on page.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

get_realtime

Visitors online right now (last 5 minutes) and what they are viewing.

ParameterTypeDescription
site_id *stringSite id from list_sites

list_sessions

Recent sessions with entry/exit page, pages viewed, duration, source, location and device.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
kindstring
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)
user_idstringOnly sessions of this identified user

get_session

Every pageview and event in one session, in order.

ParameterTypeDescription
session_id *string
site_id *stringSite id from list_sites

get_events

Custom events (sent with pagelens.track) and outbound clicks with counts and their properties.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

get_errors

JavaScript errors grouped by message, with occurrences, affected sessions and pages.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

get_journeys

Most common page-to-page paths visitors take.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
steps *array
compare_previousboolean
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
modestring
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

list_goals

Goals with conversions and conversion rate for the period, compared with the previous period.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
type *string
value *stringPage path (wildcards allowed) or event name
namestring
thresholdintegerFor 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.

ParameterTypeDescription
date *stringYYYY-MM-DD
site_id *stringSite 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
unitstring

list_users

Users active in the period: identified users (with traits) and anonymous visitors, with sessions, pageviews and first source.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
kindstring
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
searchstringMatch user id, name or email
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)

get_user

Profile of one identified user (traits, first/last seen, totals) and their sessions.

ParameterTypeDescription
site_id *stringSite 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
dimensionstring
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
limitintegerRows to return (default 10)
periodstringTime range (default 7d)
searchstringOnly queries (or pages) containing this text
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
user_id *stringIdentified 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…).

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd 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.

ParameterTypeDescription
site_id *stringSite id from list_sites
filtersarrayOptional 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,…
fromstringStart date YYYY-MM-DD (overrides period)
periodstringTime range (default 7d)
segment_idstringApply a saved segment (see list_segments); combines with filters
timezonestringIANA timezone for days and hours, e.g. Europe/Berlin (default UTC)
tostringEnd date YYYY-MM-DD, inclusive (default today)