Label the analytics dashboard sessions, because that is what it counts - #248
Merged
Conversation
The dashboard's headline number has always been sessions presented as users. The pipeline requests Metric(name='sessions') from GA4 and stored the result in a column named 'users', which surfaced here as 'Monthly Users', 'Active Users by Country' and 'Active Users (per capita) by Country'. Every figure on the page overstated the audience it claimed to measure -- sessions typically run about 1.3-1.6x users on content sites. The pipeline side landed in QuantEcon/website-dynamic#29 and is already published: map_data.json and month_data.json now carry sessions and sessions_per_capita alongside the original users fields, with identical values, so this change can be made without a flag day. See QuantEcon/website-dynamic#9 for the full reasoning. This switches the four field reads to the new names and relabels the charts and navigation. Rendered values are unchanged -- verified against the live published JSON, where sessions equals users for every row. Also adds the cross-property caveat that QuantEcon/website-dynamic#9 asks be written down next to the chart: these are visits rather than people, and sessions are reported precisely because they can be summed across the eight lecture series while user counts cannot. The per-capita chart now reads sessions_per_capita, which is null for countries with no known population rather than 0. Plotly leaves those uncoloured instead of placing them at the bottom of the colour ramp, which is what made Taiwan look like it had no readers. Section anchor ids are left alone so existing deep links keep working.
✅ Deploy Preview for grand-swan-ca5201 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the QuantEcon analytics dashboard page to correctly present GA4 sessions (visits) rather than labeling the same underlying metric as users. It aligns the page with the already-live data pipeline outputs (sessions and sessions_per_capita) while keeping section anchors stable to avoid breaking existing deep links.
Changes:
- Switch JSON field reads from
users/users_per_capitatosessions/sessions_per_capitafor the country map, monthly series, and per-capita map. - Update chart titles, axis labels, colorbar titles, hover templates, and navigation link text to say “Sessions”.
- Add an explanatory note clarifying what “sessions” means and why it’s the appropriate aggregate across multiple sites/series.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to QuantEcon/website-dynamic#29. Together these complete QuantEcon/website-dynamic#9, which can be closed once this merges.
The dashboard's headline number has always been sessions presented as users. The pipeline requests
Metric(name="sessions")from GA4 and stored the result in a column namedusers, which surfaced on this page as "Monthly Users", "Active Users by Country" and "Active Users (per capita) by Country". Every figure overstated the audience it claimed to measure — sessions typically run about 1.3–1.6× users on content sites.Why this is safe to merge now
The pipeline change is already live.
map_data.jsonandmonth_data.jsoncurrently publishsessionsandsessions_per_capitaalongside the originalusersandusers_per_capita, with identical values, specifically so this page could be switched without a flag day.Verified against the live published files rather than assumed:
country,iso_alpha_3,month_formatted,sessions,sessions_per_capitausers,users_per_capitaSo the numbers on the page do not move. Only the labels change.
What changed
Four field reads —
row.users→row.sessionsin the country map and the monthly line chart, androw.users_per_capita→row.sessions_per_capitain the per-capita map — plus the chart titles, axis titles, colourbar titles, hover templates and the three navigation links.A short note above the charts carries the caveat QuantEcon/website-dynamic#9 asks be stated next to the chart rather than left implicit: these are visits rather than people, and sessions are the figure reported precisely because they can be summed across the eight lecture series while user counts cannot — one reader visiting three series would be counted three times, and free GA4 offers no cross-property deduplication. It also notes that the Chinese, Persian and French translations are counted under their English series, since they reuse the same measurement IDs.
Section anchor ids are deliberately unchanged (
#country-users,#monthly-users,#country-per-capita). Renaming them would break any existing deep link for no visible benefit, so only the link text moved.One visible change to the per-capita map
sessions_per_capitaisnullfor a country whose population is unknown, where the oldusers_per_capitawas0. Plotly leaves nulls uncoloured instead of placing them at the bottom of the ramp — which is what previously made Taiwan, on 1,587 sessions, render identically to a country with no readers at all.That was fixed upstream in QuantEcon/website-dynamic#12; in the currently published data no country is left without a denominator, so nothing renders grey today. The behaviour matters for whatever GA4 reports next.
After this merges
The
usersandusers_per_capitafields stay in the published JSON for one more cycle, then come out in a one-line change upstream. Nothing further is needed here.🤖 Generated with Claude Code