KPI and Cookies Consent Banner#275
Open
Sundraiz-Shah wants to merge 1 commit intomasterfrom
Open
Conversation
This was
linked to
issues
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements anonymous visitor tracking, an hourly KPI dashboard, and
full GDPR-compliant cookie consent.
Changes
Visitor Tracking & KPI
SiteStatsmodel to record total requests and unique visitorsper hour (date + hour as unique key)
TrackingMiddlewareto count visits anonymously using Djangosessions — no IP addresses or personal data stored
SiteStatsin Django Admin with hourly display andread-only fields
Cookie Consent
base.htmlwith Accept / Declinethe banner reappears
GDPR Compliance
legals.htmlwith full privacy notice including legal basis(GDPR Article 6(1)(a)), cookie names, durations, data controller,
and user rights
sessionid) is only created after user gives consentlegals.html— no inline styles orscripts
Settings
SESSION_SAVE_EVERY_REQUEST = Falseto delay session cookieuntil consent is given
SESSION_COOKIE_SAMESITE = Laxfor cookie securityFiles Changed
meta_creator/models.py— new SiteStats modelmeta_creator/middleware.py— tracking middlewaremeta_creator/admin.py— admin registrationmeta_creator/templates/meta_creator/legals.html— updated legal pagestatic/css/legals.css— legals page stylesstatic/foundation/js/vendor/cookie-consent.js— consent + withdraw logicstatic/foundation/js/vendor/legals.js— legals page JSstatic/foundation/js/vendor/init.js— registered cookie consent modulemeta_tool/settings.py— session cookie settingstemplates/base.html— cookie bannerTesting
cookie_consent=truefor 6 monthscookie_consent=falsefor 10 minutescookie_consent=falsefor 10 minutessessionidcookie is not set before consent is given