twentyfourhoursmedia / views-work
plugin for handling pageviews
Installs: 6 845
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 2
Open Issues: 18
Language:CSS
Type:craft-plugin
Requires
- php: ^8.0
- craftcms/cms: ^5.0.0-alpha || ^4.0.0.1
- jaybizzle/crawler-detect: ^1.2
- dev-master
- 2.2.0
- 2.1.3
- 2.1.2
- 2.1.1
- 2.1.0.0
- 2.0.3.0
- v2.0.3.0-dev
- 2.0.2.0
- 2.0.1.0
- 2.0.0.0
- 1.3.0.7
- 1.3.0.6
- 1.3.0.5
- 1.3.0.4
- 1.3.0.3
- 1.3.0.2
- 1.3.0.1
- 1.2.6
- 1.2.5
- 1.2.4
- 1.2.3
- 1.2.2
- 1.2.0
- 1.1.15
- 1.1.14
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.3
- 1.0.1
- 1.0.0
- dev-dependabot/npm_and_yarn/src/assetbundles/viewswork/src/express-4.19.2
- dev-dependabot/npm_and_yarn/src/assetbundles/viewswork/src/webpack-dev-middleware-5.3.4
- dev-dependabot/npm_and_yarn/src/assetbundles/viewswork/src/follow-redirects-1.15.6
- dev-ward
- dev-dependabot/npm_and_yarn/src/assetbundles/viewswork/src/es5-ext-0.10.64
- dev-dependabot/composer/craftcms/cms-4.7.0
- dev-#107-order-by-popular
- dev-craft4-dev
- dev-views-work-41-block-cookie-urls-on-a-per-site-basis
- dev-views-work-42-mention-reset-url-in-dashboard
- dev-v1.3-dev
- dev-views-work-39-allow-to-programmatically-increase-the-view-counter,-bypassing-the-pixel
- dev-views-work-37-access-views-work-recordings-directly-on-the-element/entry
- dev-views-work-35-exclude-by-query-parameter
- dev-views-work-13-select-site-in-widget-for-multisite-installs
- dev-views-work-9-include-sort-by-popularity-option-in-cp-for-entries-if-possible
- dev-views-work-27-simplify-front-end-api
- dev-views-work-24-add-installation-instructions
- dev-views-work-26-add-index-for-viewing-now
- dev-views-work-25-make-autorefreshing-widget-optional
- dev-revert-21-v1.3-dev
- dev-views-work-20-add-currently-'viewed'-widget
- dev-views-work-14-improve-widget-layout
- dev-views-work-17-block-bots
- dev-views-work-15-general-styling
- dev-views-work-11-ensure-secrets-are-set-when-installing-the-plugin
- dev-views-work-8-blocklist-/-ignore-registration,-based-on-cookie-or-event
- dev-views-work-3-reset-weekly,-daily-views-with-a-special-url-instead-of-command-line-only
- dev-views-work-2-broke-admin-dashboard
This package is auto-updated.
Last update: 2024-03-29 11:06:34 UTC
README
Views work 2.x is compatible with Craft CMS version 4.0 or higher.
Please view the full documentation at io.24hoursmedia.com!
- Track pageviews by day, week, month or grand total
- View popular entries in a widget
- Get popular entries and pageviews on the front-end in twig
- Uses a signed tracking image to register only real page views
Usage
Show a beacon 1px x 1px image to register a pageview:
{# render the image for registration #}
{{ entry | views_work_image }}
Get popular items:
{% set entries = craft.entries.section('articles').orderByPopular('week', 1).limit(10) %} %}
{# show this weeks views (also supported: today, thisMonth, total) #}
{{ entries.viewsWork.thisWeek }}
Resetting view counters
Some view counters need to be periodically reset (such as the daily and weekly counters). You can either do this with a special url (provided in the control panel), or by setting up a cron job or using a special url.
Resetting views with a cron job
Execute this cron at an approprate time, i.e. once every day at 00:01 pm.
It resets the daily, weekly and monthly view counters.
The cron checks wether it is the first day of the week or month before resetting monthly or weekly views.
./craft views-work/default/reset-views
Screenshots
Brought to you by 24hoursmedia