Skip to content

Instantly share code, notes, and snippets.

@altescape
Last active May 31, 2023 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altescape/f9209768e15ec25b0489517ef67b32b8 to your computer and use it in GitHub Desktop.
Save altescape/f9209768e15ec25b0489517ef67b32b8 to your computer and use it in GitHub Desktop.
An example query of Cloudflare Web Analytics using GraphQL
# rumPageloadEventsAdaptiveGroups: for visits and pageloads
# rumPerformanceEventsAdaptiveGroups: for performance metrics
# rumWebVitalsEventsAdaptiveGroups: for Web Vitals metrics
query {
viewer {
accounts(filter: { accountTag: "abc123" }) {
rumPageloadEventsAdaptiveGroups(
filter: { date_in: ["2023-05-23", "2023-05-24"], siteTag: "def456" }
limit: 10
) {
count
dimensions {
countryName
requestPath
date
deviceType
userAgentOS
userAgentBrowser
requestHost
refererHost
refererPath
refererScheme
}
},
rumWebVitalsEventsAdaptiveGroups(
filter: { date_in: ["2023-05-23", "2023-05-24"], siteTag: "def456" }
limit: 10
) {
dimensions {
firstInputDelayElement
largestContentfulPaintPath
},
quantiles {
cumulativeLayoutShiftP50
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment