Queries
Example APL queries for analyzing the data Do11y sends to Axiom. Replace do11y with your dataset name in each query.
For more on APL, see Query data with Axiom.
Traffic and discovery
Entry points
Find the most common first pages users land on.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| summarize entries = count() by path
| order by entries desc
| take 20Traffic sources
See where your visitors come from.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| summarize sessions = count() by referrerDomain
| order by sessions descEntry point by referrer
Understand which sources land on which pages.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| summarize sessions = count() by referrerDomain, path
| order by sessions desc
| take 30AI traffic overview
See how much of your documentation traffic comes from AI platforms.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| summarize
total = count(),
aiSessions = countif(referrerCategory == 'ai'),
searchSessions = countif(referrerCategory == 'search-engine'),
directSessions = countif(referrerCategory == 'direct'),
socialSessions = countif(referrerCategory == 'social'),
communitySessions = countif(referrerCategory == 'community'),
codeHostSessions = countif(referrerCategory == 'code-host'),
otherSessions = countif(referrerCategory == 'other')
| extend aiPct = round(100.0 * aiSessions / total, 1)AI traffic by platform
Break down AI traffic by platform (ChatGPT, Perplexity, Claude, etc.).
['do11y']
| where eventType == 'page_view' and isFirstPage == true and referrerCategory == 'ai'
| extend aiPlatform = column_ifexists('aiPlatform', '')
| summarize sessions = count() by aiPlatform
| order by sessions descAI traffic trend
Track AI-referred sessions over time.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| extend week = startofweek(_time)
| summarize
total = count(),
ai = countif(referrerCategory == 'ai')
by bin_auto(_time), week
| extend aiPct = round(100.0 * ai / total, 1)
| order by week ascPages discovered via AI
Find which documentation pages AI platforms link to most.
['do11y']
| where eventType == 'page_view' and isFirstPage == true and referrerCategory == 'ai'
| extend aiPlatform = column_ifexists('aiPlatform', '')
| summarize sessions = count() by path, aiPlatform
| order by sessions desc
| take 30AI vs non-AI engagement
Compare engagement depth for AI-referred visitors vs other sources.
['do11y']
| where eventType == 'page_exit'
| summarize
visits = count(),
avgTime = avg(activeTimeSeconds),
avgScroll = avg(maxScrollDepth),
avgEngagement = avg(engagementRatio)
by referrerCategory
| order by visits descTraffic source breakdown
Summarize traffic by category.
['do11y']
| where eventType == 'page_view' and isFirstPage == true
| summarize sessions = count() by referrerCategory
| order by sessions descEngagement and page performance
Page engagement score
Combine time, scroll depth, and engagement ratio into a single score.
['do11y']
| where eventType == 'page_exit'
| summarize
avgActiveTime = avg(activeTimeSeconds),
avgEngagement = avg(engagementRatio),
avgScrollDepth = avg(maxScrollDepth),
visits = count()
by path
| where visits > 10
| extend engagementScore = (avgActiveTime * avgEngagement * avgScrollDepth) / 100
| order by engagementScore descScroll completion rate
Find pages where users read to the end.
['do11y']
| where eventType == 'page_exit'
| summarize
total = count(),
completed = countif(maxScrollDepth >= 90)
by path
| extend completionRate = round(100.0 * completed / total, 1)
| where total > 10
| order by completionRate descBounce detection
Identify pages with high bounce rates (low scroll, low time).
['do11y']
| where eventType == 'page_exit'
| summarize
avgTime = avg(activeTimeSeconds),
avgScroll = avg(maxScrollDepth),
visits = count()
by path
| where visits > 5
| where avgTime < 10 and avgScroll < 25
| order by visits descWhere users get stuck
Exit pages
Find where sessions end (excluding single-page sessions).
['do11y']
| where eventType == 'page_view'
| order by _time asc
| summarize
pages = make_list(path),
pageCount = count()
by sessionId
| where pageCount > 1
| extend firstPage = tostring(pages[0]), lastPage = tostring(pages[array_length(pages) - 1])
| where firstPage != lastPage
| summarize exits = count() by lastPage
| order by exits desc
| take 20Low engagement pages
Find high-traffic pages with poor engagement.
['do11y']
| where eventType == 'page_exit'
| summarize
visits = count(),
avgScroll = avg(maxScrollDepth),
avgTime = avg(activeTimeSeconds)
by path
| where visits > 20 and avgScroll < 30
| order by visits descPages with high search rate
Identify pages where users frequently open search (a potential confusion signal).
['do11y']
| summarize
pageViews = countif(eventType == 'page_view'),
searches = countif(eventType == 'search_opened')
by sessionId, path
| where pageViews > 0
| summarize
totalViews = sum(pageViews),
sessionsWithSearch = countif(searches > 0)
by path
| extend searchRate = round(100.0 * sessionsWithSearch / totalViews, 1)
| where totalViews > 10
| order by searchRate descNavigation patterns
Page-to-page transitions
See how users move between pages.
['do11y']
| where eventType == 'page_view' and isnotnull(previousPath)
| summarize transitions = count() by previousPath, path
| where transitions > 5
| order by transitions desc
| take 50Journey depth distribution
Understand how many pages users view per session.
['do11y']
| where eventType == 'page_view'
| summarize pageCount = count() by sessionId
| summarize
sessions = count(),
avgPages = avg(pageCount),
medianPages = percentile(pageCount, 50),
p90Pages = percentile(pageCount, 90)Full session journeys
View complete page sequences for multi-page sessions.
['do11y']
| where eventType == 'page_view'
| order by _time asc
| summarize journey = make_list(path) by sessionId
| extend journeyLength = array_length(journey)
| where journeyLength >= 3
| take 100Link and CTA performance
Most clicked links
Find the most popular links across all pages.
['do11y']
| where eventType == 'link_click'
| summarize clicks = count() by linkText, targetUrl
| order by clicks desc
| take 30External link destinations
See where users go when they leave.
['do11y']
| where eventType == 'link_click' and linkType == 'external'
| summarize clicks = count() by targetUrl
| order by clicks descLink clicks by section
Track specific CTAs (like "Run in Playground") by page and section.
['do11y']
| where eventType == 'link_click' and linkText contains 'Playground'
| summarize clicks = count() by path, linkSection
| order by clicks descPages with low link engagement
Find pages where users don't click links.
['do11y']
| summarize
views = countif(eventType == 'page_view'),
linkClicks = countif(eventType == 'link_click')
by path
| extend clickRate = round(100.0 * linkClicks / views, 1)
| where views > 20
| order by clickRate ascCode block engagement
Code copy rate by language
See which code languages users copy most.
['do11y']
| where eventType == 'code_copied'
| summarize copies = count() by language
| order by copies descCode copies by page
Find pages with the most code block engagement.
['do11y']
| where eventType == 'code_copied'
| summarize copies = count() by path, codeSection
| order by copies desc
| take 30Section reading patterns
Most-read sections
Find which headings users actually spend time reading.
['do11y']
| where eventType == 'section_visible'
| summarize
readers = dcount(sessionId),
avgDwell = avg(visibleSeconds)
by path, heading
| order by readers desc
| take 30Skipped sections
Identify sections that users scroll past without reading.
['do11y']
| where eventType == 'section_visible'
| summarize
readers = dcount(sessionId),
avgDwell = avg(visibleSeconds)
by path, heading
| where avgDwell < 5
| order by readers descTab switch patterns
Most switched-to tabs
See which code language or framework tabs users select.
['do11y']
| where eventType == 'tab_switch' and isDefault == false
| summarize switches = count() by tabLabel
| order by switches descTab switches by page
Understand audience preferences on specific pages.
['do11y']
| where eventType == 'tab_switch'
| summarize switches = count() by path, tabLabel, tabGroup
| order by switches desc
| take 30Table of contents usage
Most clicked TOC entries
Find the headings users jump to via the on-page TOC.
['do11y']
| where eventType == 'toc_click'
| summarize clicks = count() by path, heading
| order by clicks desc
| take 30Pages with heavy TOC usage
Identify pages where users rely on the TOC (a potential signal that the page is too long or poorly organized).
['do11y']
| where eventType in ('toc_click', 'page_view')
| summarize
tocClicks = countif(eventType == 'toc_click'),
views = countif(eventType == 'page_view')
by path
| where views > 10
| extend tocRate = round(100.0 * tocClicks / views, 1)
| order by tocRate descUser feedback
Feedback by page
See which pages get the best and worst ratings.
['do11y']
| where eventType == 'feedback'
| summarize
total = count(),
helpful = countif(rating == 'yes'),
notHelpful = countif(rating == 'no')
by path
| extend helpfulPct = round(helpful * 100.0 / total, 1)
| where total >= 3
| order by helpfulPct ascExpand/collapse patterns
Most expanded sections
Find the <details> and accordion content users most want to see.
['do11y']
| where eventType == 'expand_collapse' and action == 'expand'
| summarize expansions = count() by path, summary
| order by expansions desc
| take 30Expand rate by page
Identify pages where users frequently expand hidden content.
['do11y']
| where eventType in ('expand_collapse', 'page_view')
| summarize
expands = countif(eventType == 'expand_collapse' and action == 'expand'),
views = countif(eventType == 'page_view')
by path
| where views > 10
| extend expandRate = round(100.0 * expands / views, 1)
| order by expandRate descContent performance comparison
Page performance dashboard
View all page metrics in a single query.
['do11y']
| summarize
pageViews = countif(eventType == 'page_view'),
avgScrollDepth = avgif(maxScrollDepth, eventType == 'page_exit'),
avgTimeSeconds = avgif(activeTimeSeconds, eventType == 'page_exit'),
linkClicks = countif(eventType == 'link_click'),
codeCopies = countif(eventType == 'code_copied'),
searches = countif(eventType == 'search_opened'),
tocClicks = countif(eventType == 'toc_click'),
expands = countif(eventType == 'expand_collapse')
by path
| where pageViews > 10
| extend
clicksPerView = round(1.0 * linkClicks / pageViews, 2),
copiesPerView = round(1.0 * codeCopies / pageViews, 2)
| order by pageViews descCompare sections
Aggregate performance by URL prefix (section).
['do11y']
| extend section = extract("^/([^/]+)", 1, path)
| where eventType == 'page_exit'
| summarize
visits = count(),
avgTime = avg(activeTimeSeconds),
avgScroll = avg(maxScrollDepth)
by section
| order by visits descWeek-over-week trend
Track traffic growth over time.
['do11y']
| where eventType == 'page_view'
| extend week = startofweek(_time)
| summarize pageViews = count(), uniqueSessions = dcount(sessionId) by bin_auto(_time), week
| order by week ascDevice and context
Mobile vs desktop engagement
Compare engagement by device type.
['do11y']
| where eventType == 'page_exit'
| summarize
visits = count(),
avgTime = avg(activeTimeSeconds),
avgScroll = avg(maxScrollDepth)
by deviceTypeViewport impact on engagement
See how screen size affects user behavior.
['do11y']
| where eventType == 'page_exit'
| summarize
visits = count(),
avgScroll = avg(maxScrollDepth)
by viewportCategory
| order by visits descBrowser breakdown
Understand your audience's browser preferences.
['do11y']
| where eventType == 'page_view'
| summarize sessions = dcount(sessionId) by browserFamily
| order by sessions descKey metrics reference
| Metric | Good signal | Warning signal |
|---|---|---|
| Avg scroll depth | > 60% | < 25% |
| Avg active time | 30–120s | < 10s |
| Completion rate (90% scroll) | > 40% | < 15% |
| Pages per session | > 3 | 1 (bounce) |
| Search rate after page view | Low | High (confusion) |
| Exit rate | Low on guides | High on intro pages |
| TOC click rate | Low (well-organized) | High (page too long) |
| Feedback helpful % | > 80% | < 50% |
| Expand rate | Moderate | Very high (promote content) |
| Section avg dwell | > 10s | < 3s (skipped) |