Intelligent Textbook Page Views
Run the Intelligent Textbook Page Views MicroSim Fullscreen
About This MicroSim
This chart shows Google Analytics page-view totals for the last 90 days across every published intelligent textbook in the collection. Each bar is one textbook, ranked from most-visited to least-visited, with the exact count labeled at the end of the bar.
The chart loads its data at runtime from
ga4-pageviews-results.csv in this same directory,
so refreshing the report (see below) updates the chart with no code changes.
How to Use
- Hover over any bar to see its exact page-view count in a tooltip.
- Bars are sorted descending, so the most-used textbooks appear at the top.
- The subtitle reports the number of textbooks and the combined total.
Iframe Embed Code
You can add this MicroSim to any web page by adding this to your HTML:
1 2 3 4 | |
How the Data Is Generated
The CSV is produced by src/site-analytics/ga4-pageviews-report.py, which:
- Scans every
~/Documents/ws/*/mkdocs.ymlfor its Google Analytics property ID. - Maps each ID to its numeric GA4 property via the Analytics Admin API.
- Queries the GA4 Data API for
screenPageViewsover the last 90 days.
To refresh this chart, regenerate and copy the CSV:
1 2 3 | |
See src/site-analytics/README.md for full setup details.
Lesson Plan
This MicroSim doubles as a data-literacy example: reading and interpreting a ranked horizontal bar chart.
Duration
5-10 minutes
Activities
- Read the ranking (2 min): Identify the three most-visited and three least-visited textbooks.
- Estimate vs. exact (3 min): Estimate a mid-range bar's value from the axis, then hover to check against the labeled count.
- Interpret (5 min): Discuss why traffic varies — topic popularity, publication date, promotion, and content depth.