Reports
Send POST reports every few minutes, with the counts since the last report. Never send an IP address, a user agent, a query string, a referrer or a cookie.
What it takes
| Field | What it holds |
|---|---|
views |
Page views, as a number. |
view_kinds |
{navigate, reload, back_forward, bfcache, prerender, noscript}. |
entries, page_types |
Views that started a visit, and views per type of page. |
not_found |
[{path, referrer, hits}]. |
redirects |
[{from, hits}]. |
bots |
[{path, bot, status, verified, hits}]. |
errors |
[{level, message, file, line, hits}], and one row per 5xx answer. |
csp |
[{directive, blocked, disposition, hits}]. Only the origin of what was blocked. |
lcp |
[{path, image, device, hits}]. The image that was painted largest. |
fonts |
[{family, weight, style, hits}]. Font files fetched from the network. A variable font counts with the lower end of its range. |
weights |
[{path, bytes, requests}]. What a first view, without cache, transfers. It is used for the CO₂ per visit. |
checks |
[{name, host, result, detail, checked_at}]. Your own checks, with ok or problem. |
searches |
[{q, lang, searches, zero, clicks}]. The own search of the site. See below. |
Searches
searches counts every finished search of a person, whoever answered it. That can be your own copy, or GET search. It holds searches, of which zero found nothing, and the clicks on a result.
Do not count while someone types. Do not count suggestions on a 404, or other callers. The CMS counts nothing itself.
Per environment
view_kinds, bots, errors, fonts, weights and checks are kept per environment, and shown apart, as Live | Staging. views, not_found, redirects, csp, lcp, searches and the WebP test only come from production.
Counting views
A cached page starts no code on the server. A prerender that nobody opens does reach the server. A page from the back/forward cache never reaches it. So count with a tiny beacon, once the page is really seen:
(() => {
const send = kind => { const i = new Image(); i.src = '/_v.gif?k=' + kind; };
const nav = performance.getEntriesByType('navigation')[0];
const first = () => send(nav && nav.activationStart > 0 ? 'prerender' : (nav ? nav.type : 'navigate'));
if (document.prerendering) {
document.addEventListener('prerenderingchange', first, { once: true });
} else {
first();
}
addEventListener('pageshow', e => { if (e.persisted) { send('bfcache'); } });
})();Where the beacon goes
settings.beacon comes from GET site, per environment. It looks like {"enabled": true, "url": null}.
enabled: falsemeans: send no beacon at all. That is no view, no beacon at the end of a view, no<noscript>pixel, and no WebP test. The CMS then gets noview_kinds,page_types,entries,lcp,fontsorweightsfrom that environment. Bots and errors still come from the logs.url: nullmeans: use ours, which is/_v.gifor/_view.urlis the own address of the site. That is anhttps://address, or a path on the site. It is checked when it is saved. It has at most 300 characters, no user or password, and no#. A query string is allowed. Send it the same GET requests, with the path of the page inp, without credentials. The CMS then gets none of it either. Add its origin toconnect-srcandimg-src.
What caching saved
This is for Insights → Carbon → Saved. It also goes in the report. Everything is optional, and per environment. See FRONTEND.md for the details.
speculationgives the speculative requests and their bytes, per path, purpose and rule tag. The purpose isprefetch,prerenderorprefetch_other.speculation_usedgives the views that came from a speculation, per path and purpose.servergives the page requests from the log. Per kind,fullorthin, it gives the PHP requests with their time, CPU time and peak memory.bfcache_missedgives the back or forward views that were not restored, per path and with the reason of Chrome.weightsrows of warm views and back/forward views count too. What they did not send is what was saved.
Good to know
botsdecide redirects. When an address changes, the CMS skips the redirect if no bot fetched the old address since bots were first reported. So only sendbotswhen you see all of them.- For
weights,transferSizeis 0 for other origins withoutTiming-Allow-Origin. So third parties are counted too low.
Also called: analytics API, telemetry, beacon, RUM, web vitals reporting, server logs.
Last changed