Documentation
LiteShoper Traffic: Full Guide & Analytics Setup
LiteShoper Traffic (liteshoper-traffic) is privacy-friendly storefront analytics that runs on your server. Track pageviews and unique visitors, see countries and referrers, and view all-time counts next to each product and blog post — no Google Analytics account required.
On this page: Overview · Prerequisites · Install · Enable tracking · Settings · Cron · Dashboard · Products & posts · How tracking works · Country detection · URLs · Checklist · Troubleshooting
1. Overview
- JS beacon + server-side hit recording on storefront pages
- Dashboard KPIs, charts, countries, top pages, referrers, devices, browsers, OS
- Filters by period, page type, country, and device
- Total views column on Products and Posts admin tables
- Per-product / per-post traffic detail pages
- Exclude logged-in admins from full analytics
- Configurable hit retention with cron rollup + purge
- Data stays on your store (no third-party analytics vendor required)
Plugin page: liteshoper.com/plugins/liteshoper-traffic
2. Prerequisites
- LiteShoper store with a working storefront theme
- Active
liteshoper-trafficmarketplace license (subscription) - Ability to schedule an HTTP cron job (hourly recommended)
- Optional: Cloudflare or another CDN that sends country headers for better geo stats
Unlike Shippo or WhatsApp, there is no external API signup. After install, enable tracking and schedule cron.
3. Install the plugin
- Subscribe / install from LiteShoper → LiteShoper Traffic
- Activate the plugin on your store
- Open admin menu Shop → Traffic
Slug: liteshoper-traffic (older installs may have been renamed from liteshop-traffic).
4. Enable tracking
- Go to Traffic → Settings
- Check Enable storefront traffic tracking
- Optional: check Exclude logged-in admin sessions so your own browsing does not inflate charts
- Set Hit retention (days) — default 90; range 7–730
- Click Save settings
Raw hits and daily rollups older than retention are deleted by cron. Entity view totals (product/post Total views) are kept.
5. Settings reference
| Setting | What it does |
|---|---|
| Enable tracking | Turns storefront collection on/off |
| Exclude admins | Skips full analytics hits + beacon for logged-in admins. Product/post “Total views” can still increase when admins browse. |
| Hit retention | How long raw/daily data is kept before purge |
| Rotate collect secret | Invalidates signed beacon payloads until pages reload |
| Rotate cron token | Changes the cron URL; update your scheduler |
| Clear all traffic data | Deletes hits, daily aggregates, and entity totals (irreversible) |
6. Schedule cron (required for clean stats)
Cron rolls up daily aggregates and purges old hits. Schedule hourly (or with your other store crons):
GET https://YOUR-STORE.com/cron/traffic?token=YOUR_CRON_SECRET
- Copy the URL from Traffic → Settings → Cron
- Add it to your host panel, system cron, or uptime monitor
- Or click Run cron now once to verify
Cron is throttled (~55 seconds) to avoid accidental double runs.
7. Use the Traffic dashboard
- Open Shop → Traffic (Dashboard)
- Apply filters:
- Period — last N days
- Page type — home, shop, product, blog, post, cart, checkout, other
- Country
- Device — desktop / mobile / tablet
- Review KPIs (today + period), charts, country map/list, top pages, referrers, devices, browsers, OS, and recent hits
8. Product & post pageviews
- Admin Products and Posts tables show a Total views column
- Click the number to open Traffic Detail for that product or post
- Path:
traffic/entity?type=product&id=…ortype=post
9. How tracking works
- On storefront page load, the plugin records a server-side view when possible
- A small beacon script (
beacon.js) posts to/traffic/collectwith a signed payload - Bots / common crawlers are filtered where possible
- Rate limits protect the collect endpoint
- Cron builds
traffic_dailyrollups for faster dashboard queries
If a theme skips get_header(), a shutdown backup still attempts to record the hit.
10. Country detection
Country codes come from available request headers when your CDN/proxy provides them (for example Cloudflare). Without geo headers, some traffic may show as unknown (XX). For best maps, put the store behind Cloudflare or another CDN that injects country headers.
11. Admin pages
| Page | Path | Purpose |
|---|---|---|
| Dashboard | traffic |
KPIs, charts, countries, pages, referrers |
| Settings | traffic/settings |
Enable, retention, cron, secrets, clear data |
| Entity detail | traffic/entity |
Per-product or per-post report |
12. URL reference
| Path | Purpose |
|---|---|
POST /traffic/collect |
Signed storefront beacon |
GET /cron/traffic?token=… |
Rollup + retention purge |
13. Go-live checklist
- Plugin installed and activated
- Tracking enabled in Settings
- Exclude admins on (recommended for cleaner stats)
- Cron URL scheduled hourly
- Browse the storefront in a private/incognito window (not as admin)
- Refresh Traffic dashboard — pageviews increase
- Confirm Views column on Products / Posts
14. Troubleshooting
| Issue | Fix |
|---|---|
| Dashboard stays at zero | Enable tracking; browse while logged out (if exclude admins is on); hard-refresh storefront; wait a minute and reload dashboard |
| Only admin traffic missing | Expected when Exclude admins is enabled |
| Cron 403 Forbidden | Token mismatch — copy the URL again or rotate cron token and update the scheduler |
| Old chart data bloated | Lower retention days and run cron |
| Country mostly XX / unknown | Use a CDN that sends country headers (e.g. Cloudflare) |
| Beacon / collect errors after rotate | Reload storefront pages so new collect signatures are issued |
| Views column missing | Confirm plugin is active; open Products/Posts list (not a custom admin screen) |
References:
LiteShoper Traffic plugin · In-store guide: Shop → Traffic → Settings