Last updated
CDN logs
Example log. Not this site's traffic. The paths borrow names from this site, and /old-offer exists only in the example. A Vercel log drain could POST these fields to an HTTPS endpoint. This page does not open a drain, a project, or this site's requests.
Why you'd want to
Filters run over a seeded example edge log and summarize hit ratio, edge ratio, median time to first byte, errors, and bots. The rows are an example, not this site's requests.
How to use it
Fetch loads an invented batch in the browser. A Vercel log drain would plug in behind the same batch shape. This button does not call Vercel.
No batch loaded. The charts stay empty until you fetch.
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The CDN logs lab filters a seeded edge log and summarizes hit ratio, edge ratio, median time to first byte, errors, and bots. The rows are an example, and the lab does not call Adobe.
Plant a day of example rows
exampleRows walks 24 hours with a fixed seed, then adds ten 500 responses at 03:00 on /lab/d3. fetchExampleBatch returns that batch after a short wait and does not call a log drain.
Filter the rows in memory
applyFilter keeps a row when its minute, cache, client, POP, path, status, country, and time to first byte sit inside the filter. An empty filter field does not constrain that column.
Summarize the filtered set
summarize divides HIT rows by every row for the hit ratio, and HIT plus STALE for the edge ratio. Median time to first byte uses the middle of the sorted times. Errors are status 400 and above. Bots are client bot.
Leave the summary on the page
slowestPath needs at least eight rows. The lab section is data-track-ignore. This page does not call trackLabEvent.
Every filter field is optional. A miss drops the row.
export function applyFilter(rows: LogRow[], filter: LogFilter) {
return rows.filter((row) => {
if (row.t < filter.startMin || row.t >= filter.endMin) return false
if (filter.cache && row.cache !== filter.cache) return false
if (filter.client && row.client !== filter.client) return false
if (filter.pop && row.pop !== filter.pop) return false
if (filter.path && row.path !== filter.path) return false
if (filter.status != null && row.status !== filter.status) return false
if (filter.country && row.country !== filter.country) return false
if (filter.ttfbMin != null && row.ttfbMs < filter.ttfbMin) return false
if (filter.ttfbMax != null && row.ttfbMs >= filter.ttfbMax) return false
return true
})
}Hit ratio, edge ratio, median time to first byte, errors, and bots.
export function summarize(rows: LogRow[]) {
if (!rows.length) {
return { count: 0, hitRatio: null as number | null, edgeRatio: null as number | null, medianTtfb: null as number | null, errorRatio: null as number | null, botRatio: null as number | null, bytes: 0 }
}
const hits = rows.filter((row) => row.cache === "HIT").length
const edge = rows.filter((row) => row.cache === "HIT" || row.cache === "STALE").length
const errors = rows.filter((row) => row.status >= 400).length
const bots = rows.filter((row) => row.client === "bot").length
return {
count: rows.length,
hitRatio: hits / rows.length,
edgeRatio: edge / rows.length,
medianTtfb: median(rows.map((row) => row.ttfbMs)),
errorRatio: errors / rows.length,
botRatio: bots / rows.length,
bytes: rows.reduce((sum, row) => sum + row.bytes, 0),
}
}This lab does not queue its own event. The Google block shows an example of how you would track the interaction. Adobe is an example too.
This lab does not queue an analytics event of its own. After Accept, the site still queues virtual_page_view for the page, with page_path and page_title. Clicks inside a data-track-ignore region are not recorded. The push below is an example, not a call this page makes. This site does not call gtag('set') or Adobe.
Example only. This page does not push this object.
// Example only. This lab does not queue this event.
dataLayer.push({
event: "cdn_log_row_example",
cache: "HIT",
pop: "iad1",
})Example implementation. This site does not call Adobe. eVar55, prop55, and event55 are example variable numbers. In Launch, a data element reads the value and a rule sends it when the value changes. In the report suite, enable eVar55 with Most Recent allocation and expire it on the hit. A processing rule is unnecessary if the data element maps straight to that eVar.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
cacheStatus: "HIT",
},
},
})Example hit. eVar55 is hit-scoped in this example. prop55 dies at the same hit.
s.eVar55 = "HIT"
s.prop55 = "HIT"
s.events = "event55"
s.linkTrackVars = "eVar55,prop55,events"
s.linkTrackEvents = "event55"
s.tl(true, "o", "cdn_log_row_example")Each lab field, the GA4 name, and the example Adobe variable. Scope is the part that usually gets lost in the translation.
Cache status
GA4. Not sent. The example row is HIT, MISS, or STALE.
Adobe. Example eVar55, expire on the hit.
Scope. Hit. A user-scoped cache status would stick after this example row.
POP
GA4. Not sent. The example POP id is the edge region on the row.
Adobe. Example prop55 on the hit.
Scope. Hit. The region belongs to the example row, not to the visit.
Hit ratio
GA4. Not sent.
Adobe. Example: do not write the ratio into eVar55.
Scope. A summary of the filtered rows. It is not an event metric.
Client kind
GA4. Not sent. client is browser or bot on the example row.
Adobe. Example prop55. Not sent.
Scope. Hit. A visit-scoped kind would mix a bot row into the rest of the visit.
What an API request is: one program asking another for data, or asking it to do something. This page calls Wikidata and shows both the request and the response.
Data APIs this site calls, grouped: Trends, Search Console, PageSpeed, Wikidata, Open-Meteo, and sitemap submission. Each card opens that lab.
The body of one page view, the gate it has to pass, and the record that comes back.