You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add Google Analytics to the page, and add auto-reporting to Wikipedia Page "WP:WikiLoop_DoubleCheck/stats" (fix link for me), which depends on /fr proper cookie concent bar setup and /fr Google Analytics ID and API authentication for reporting
Agent's Two Cents (could be wrong)
Everything below is the AI agent's best guess based on the current codebase.
Take with a grain of salt — the original request above is the only thing that came from a human.
Wikipedia page link fix: The correct link is likely Wikipedia:WikiLoop DoubleCheck/Statistics — the WP: shortcut resolves to Wikipedia:. The exact subpage name should be confirmed by the requester.
Problem / Motivation
WikiLoop DoubleCheck has zero usage analytics. There's no visibility into how many people use the tool, which features are popular, or where users drop off. Additionally, the Wikipedia community has no easy way to see the project's impact. Publishing stats to a Wikipedia project page would increase transparency and help with community engagement and Wikimedia grant reporting.
Proposed Solution
Two parts:
Client-side GA4 tracking on the web app, gated behind cookie consent
Server-side cron job that queries GA Data API + MongoDB stats and publishes a formatted summary to a Wikipedia project page via the MediaWiki API
Bot account or OAuth token — Writing to Wikipedia requires either a registered bot account or the server using an authorized user's OAuth token. A bot account is preferred for automated edits (see Wikipedia:Bots)
Wikipedia bot approval — Automated edits to Wikipedia may require bot approval if running frequently. Low-frequency edits (daily/weekly) from a logged-in user account may be acceptable without formal bot status
The @google-analytics/data npm package is needed for server-side GA API queries
How to Validate
GA4 tracking snippet loads ONLY after cookie consent opt-in
Original Request
Agent's Two Cents (could be wrong)
Wikipedia page link fix: The correct link is likely Wikipedia:WikiLoop DoubleCheck/Statistics — the
WP:shortcut resolves toWikipedia:. The exact subpage name should be confirmed by the requester.Problem / Motivation
WikiLoop DoubleCheck has zero usage analytics. There's no visibility into how many people use the tool, which features are popular, or where users drop off. Additionally, the Wikipedia community has no easy way to see the project's impact. Publishing stats to a Wikipedia project page would increase transparency and help with community engagement and Wikimedia grant reporting.
Proposed Solution
Two parts:
Architecture Diagram
Dependencies & Potential Blockers
@google-analytics/datanpm package is needed for server-side GA API queriesHow to Validate
Scope Estimate
large
Key Files/Modules Likely Involved
packages/web/index.htmlorpackages/web/src/App.vue— GA snippet injection (conditional on consent)packages/web/src/composables/useConsent.ts— consent check before loading GA (from Add GDPR-compliant cookie consent bar #16)packages/server/src/cron/— new stats reporting cron jobpackages/server/src/lib/— new GA Data API client and Wikipedia stats publisherpackages/server/src/db/models/— aggregate queries for judgement/user statsRough Implementation Sketch
Part 1: GA4 Client Tracking
useConsent()composableGOOGLE_ANALYTICS_IDenv var (or hardcoded since it's public)Part 2: Wikipedia Stats Auto-Publisher
packages/server/src/cron/statsPublisher.tsaction=editusing bot/OAuth credentialsOpen Questions
Wikipedia:WikiLoop_DoubleCheck/Statisticscorrect, or should it beWikipedia:WikiLoop DoubleCheck/statsor another subpage?User:WikiLoopBot) or use an existing user's OAuth token for the edits?Potential Risks or Gotchas
Related Issues