-
-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ecommerce 2020 queries #1135
Ecommerce 2020 queries #1135
Conversation
Hey @jrharalson. I know this isn't marked for review yet, but I wanted to give you a quick heads up about something. There's a new SQL naming convention this year where we'll be naming the queries more descriptively based on what they're analyzing as opposed to chapter/metric numbers. So for example |
Be sure to update this from "Draft" to "Ready for review" so we can get more eyes on it |
SELECT | ||
client, | ||
ecomm, | ||
AVG(ROUND(SAFE_DIVIDE(fast_lcp, fast_lcp + avg_lcp + slow_lcp) * 100, 2)) AS fast, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than averages, I'd propose using one of these alternatives:
- use 10,25,50,75,90 percentiles to summarize the distribution of pages' fast/avg/slow LCP
- calculate the percent of pages with good LCP (fast / fast+avg+slow >= 75%) and poor LCP (slow / fast+avg+slow >= 25%), with "needs improvement" being everything else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The second suggestion can be easily adapted from the CMS chapter's query by replacing WHERE category = 'CMS'
with 'Ecommerce'
. This gives you LCP, FID, CLS, and the overall CWV assessment.
You can also adapt this query of good/ni/poor speeds for each metric.
AND | ||
IF(device = 'desktop', 'desktop', 'mobile') = client | ||
WHERE | ||
date = '2020-07-01' AND |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
date = '2020-07-01' AND | |
date = '2020-08-01' AND |
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(750)] / 1024, 2) AS p75, | ||
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(900)] / 1024, 2) AS p90 | ||
FROM | ||
`httparchive.summary_pages.2020_07_01_*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Throughout)
`httparchive.summary_pages.2020_07_01_*` | |
`httparchive.summary_pages.2020_08_01_*` |
USING | ||
(client, page) | ||
WHERE | ||
NET.HOST(url) IN (SELECT domain FROM `httparchive.almanac.third_parties`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Throughout)
NET.HOST(url) IN (SELECT domain FROM `httparchive.almanac.third_parties`) | |
NET.HOST(url) IN (SELECT domain FROM `httparchive.almanac.third_parties` WHERE date = '2020-08-01') |
_TABLE_SUFFIX AS client, | ||
vendor, | ||
app, | ||
COUNTIF(category = 'AMP') AS AMPfromFreq, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is AMP a category or app?
COUNT(0) AS total, | ||
ROUND(COUNTIF(category = 'CDN') * 100 / COUNT(0), 2) AS pct | ||
FROM | ||
`httparchive.sample_data.technologies_*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And group by _TABLE_SUFFIX
`httparchive.sample_data.technologies_*` | |
`httparchive.technologies.2020_08_01_*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the feedback. Made a few updates and push a few updates that were stuck pending a check-in. Need to rework the LCP sql later.
@jrharalson sounds good let me know when this is ready for another review |
@jrharalson how's this coming along? |
Updated to the latest Crux style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small correction, then this should be good to go
Progress on #914
Initial check-in PR/placeholder