FotoGrids includes a built-in statistics system that tracks how visitors are using your Galleries, Albums, and individual items. It records two simple numbers per object — views and shares — and surfaces them inside wp-admin without sending any data off your site. There is no third-party tracker, no JavaScript loaded from another domain, and no visitor cookie.
This article covers what FotoGrids tracks today, where to see the data, how retention works, and what the larger analytics product looks like on the roadmap.
Location FotoGrids → Statistics
What gets tracked #
FotoGrids tracks two metrics across three object types.
| Object | Views | Shares |
|---|---|---|
| Gallery | Each time a Gallery is loaded on a public page. | Each time the Gallery itself is shared from the share menu. |
| Album | Each time an Album is loaded on a public page. | Each time the Album itself is shared. |
| Item | Each time an item is opened in the Lightbox. | Each time an item is shared from inside the Lightbox. |
A view is recorded the moment the relevant object becomes visible — when a Gallery renders on the page, when an Album mosaic renders, or when an item is opened in the Lightbox. A share is recorded only when the share action is initiated from the FotoGrids share UI; it does not track outbound clicks to social networks after the fact.
Data is stored in a dedicated table ({prefix}fotogrids_statistics) and is keyed by (object_type, object_id). Each row stores the current total views, total shares, and the timestamp of the most recent view.
Statistics are stored on your own server. Nothing is sent to FotoGrids, Anthropic, Google, or any third party. The numbers in the dashboard are yours alone.
Where statistics appear #
Three places inside wp-admin show statistics today.
Statistics page
Location FotoGrids → Statistics
The main Statistics page lists every Gallery, every Album, and every item that has recorded at least one view or share. Each row shows the totals and the last-viewed timestamp. The page is read-only — its purpose is to give an at-a-glance picture of what is being seen.
Gallery and Album columns
The list tables at FotoGrids → Galleries and FotoGrids → Albums include a Views column. The number shown is the total view count for that Gallery or Album since tracking began (subject to the retention window described below).
Dashboard widget
A FotoGrids widget appears on the WordPress dashboard for users with the manage_fotogrids capability. It summarises the most-viewed Galleries from the last 30 days so the numbers are visible without navigating to the plugin’s pages.
How views are counted #
A view is counted once per page render, not once per visitor. If the same visitor reloads the page, that is two views. If a Gallery appears twice on the same page (a rare but possible setup), each render is counted independently. FotoGrids does not deduplicate views by IP, session, or cookie — keeping the tracker stateless is what allows it to work without any visitor identifier.
For items, the view is counted the moment the Lightbox actually opens on that item — not when the thumbnail is rendered in the grid. Navigating from one item to the next inside an open Lightbox counts each item separately.
Views are recorded by a request to POST /wp-json/fotogrids/v1/stats/view from the frontend. The endpoint is intentionally public — Galleries need to be able to record views on pages where no visitor is logged in. The endpoint accepts only object_type and object_id, both validated, and writes through a prepared statement.
How shares are counted #
Shares are recorded when the visitor activates a share action from the FotoGrids share UI — either inside the Lightbox for an item, or from the share menu on a Gallery or Album. The share is recorded by a request to POST /wp-json/fotogrids/v1/stats/share with the network name.
For developers, every share also fires the fotogrids/actions/share/tracked action, with $object_type, $object_id, and $network as parameters. This is the hook to use for forwarding share events to an external analytics platform.
Retention #
By default, statistics rows are retained for 365 days from their last view. A scheduled task runs weekly and removes any row whose last_viewed timestamp is older than the retention window. Totals are not preserved when a row is removed — once a row falls out of the window, its lifetime totals are dropped along with it.
The retention period can be changed by site owners and developers via a filter:
add_filter( 'fotogrids/settings/stats/retention_days', function() {
return 730; // keep two years of statistics
} );
Setting the value to 0 disables automatic cleanup — useful for sites that want to keep historical data indefinitely, at the cost of an ever-growing statistics table.
Cleanup is keyed by last viewed, not by creation date. An item that is still being viewed regularly will not be cleaned up — only objects that have been completely inactive for the full retention window are pruned.
What’s not tracked yet #
FotoGrids’ statistics system is deliberately small. The following are not tracked today and are part of the larger Analytics roadmap rather than the core statistics system:
- Per-visitor sessions and unique visitor counts
- Time spent viewing each item or each Gallery
- Where the visitor came from (referrer, traffic source)
- Device, browser, country, language
- Conversion or click-through tracking
- Per-Gallery comparison charts and date-range filtering
- CSV or PDF export
These are covered by the upcoming Advanced Analytics — see the Advanced Analytics article for a preview of what the Pro side of statistics will add.
Tips #
The numbers in the statistics page are most useful when the Galleries have been live for at least a few days. A brand-new Gallery will read zero for several pageloads while the first views accumulate.
If statistics aren’t appearing for a Gallery you can see is being viewed, two things to check before reaching out to support: the Gallery must actually be loaded on a public page (a preview inside the editor does not count), and request-blocking browser extensions can occasionally cancel the stats request before it reaches the REST endpoint. The Stats Not Recording article in the Troubleshooting section walks through the full checklist.