Background
The home page shows only the three most recent posts, so a first-time visitor has no way to tell where to start. Which posts actually get read is already in GA4, but the site does not use it.
Goal
A popular posts section on the home page, ranked by GA4 pageviews.
Plan
- Create a service account and give it viewer access to the GA4 property. Keep the key in repository secrets.
- At build time, call the GA4 Data API for the top posts over the last 30 days and write the result to JSON.
- Add the section to the home page. Exclude the problem-solving posts.
Verify
- The local build still runs without the secret.
- If the API call fails, the section is not rendered and the deploy still passes.
Notes
Measurement ID G-7BMWW1711K. This comes after the deploy work.
Background
The home page shows only the three most recent posts, so a first-time visitor has no way to tell where to start. Which posts actually get read is already in GA4, but the site does not use it.
Goal
A popular posts section on the home page, ranked by GA4 pageviews.
Plan
Verify
Notes
Measurement ID
G-7BMWW1711K. This comes after the deploy work.