Overview
Toplytics is a WordPress plugin that displays your most visited posts based on statistics extracted directly from Google Analytics (GA4).
Traditional popular posts plugins record every pageview to the local WordPress database, which often leads to severe DB bloat and server performance degradation under heavy traffic.
By delegating view tracking to Google and periodically fetching aggregated ranking data, Toplytics ensures your server remains light and responsive.
Distribution Page: https://wordpress.org/plugins/toplytics/
Conclusion
We strongly recommend Toplytics for high-traffic blogs and websites running on limited server resources where stability and speed are paramount.
While setting up Google Cloud OAuth credentials and configuring filters requires a bit of technical comfort, it completely eliminates the server risks associated with database-heavy tracking plugins.
Key Features
- Zero Database Load
Avoids writing to the database on every pageview by fetching pre-aggregated statistics from Google Analytics in scheduled batches. - Full-Page Cache Compatibility
Provides an asynchronous JavaScript (AJAX) loading option so popular post widgets update seamlessly even on fully cached static pages or CDN edges. - Flexible Integration Options
Easily display rankings using WordPress widgets, shortcodes, or native PHP functions for custom theme development.
What It Can Do
- Custom Time Ranges
Display rankings filtered by today, past week, or past month. - REST API and JSON Endpoints
Expose ranking metrics via/wp-json/toplytics/resultsortoplytics.jsonfor custom headless and dynamic frontend rendering. - Post Type and Category Filtering
Target specific post types (e.g., standard posts, custom post types) and restrict rankings to designated categories. - Thumbnail and View Count Toggles
Control whether featured images and Google Analytics view counts appear in your output.
Best Use Cases
It shines when growing traffic causes standard popular post plugins to slow down your database queries and admin dashboard.
Additionally, if you rely heavily on full-page caching mechanisms like Cloudflare Edge Caching or performance plugins, Toplytics' AJAX rendering ensures your dynamic ranking displays accurately without purging cached pages.
Considerations
- Initial Google API Configuration
Requires creating a project in Google Cloud Console, enabling the Google Analytics API, and generating OAuth 2.0 credentials (Client ID / Client Secret). - Fetch Count vs. Allowed Post Types
If your top visited URLs include pages or custom post types that are filtered out, the remaining display count may be smaller than expected. Set "Posts to fetch from GA" high enough to ensure sufficient eligible posts are retrieved. - Template Customization
Default widget output is a plain list structure; custom styling or creating acustom.template.phpfile is necessary if you want a tailored, card-style layout.
Summary
Toplytics takes a bit of effort to set up initially, but the peace of mind that comes with zero database overhead and reliable Google Analytics metrics is unmatched.
If you are serious about server performance and clean database maintenance, it is well worth the investment.






Comments