Repository navigation
Add Google Analytics (GA4) and a Privacy section on About - #30
Merged
Merged
Conversation
- Loads GA4 (G-0SRRQJ1BBN, shared "ehcrea calculators" property) only on ehcrea.github.io; skipped with Do Not Track / Global Privacy Control or when the visitor turns it off on About (localStorage "ehcrea.analytics"). - Reports origin + path only (no ?query or #hash, which can hold inputs); Google signals and ad personalisation off. Page views sent on load and on history changes between calculator pages. - About: "Privacy" section with an on/off switch, EN/DE/NL/TR/ES. - Offline: the gtag request just fails; the service worker ignores it. - sw.js rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DtSyM6ecWfzSkE6fxd3dp3
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.
Requested by Eren · project thread
Same change in all 8 calculator repos.
What
G-0SRRQJ1BBN(new property "ehcrea calculators", one web stream for https://ehcrea.github.io), loaded from a snippet at the end of the app script.ehcrea.github.io(not localhost or file), and not when the browser sends Do Not Track or Global Privacy Control, or when the visitor turned it off on About (localStorage["ehcrea.analytics"] = "off").?queryand#hashare left out because they can hold saved inputs and share links. Google signals and ad personalisation are off. Page views are sent on load and when the app moves to another calculator page. "Page changes based on browser history events" is turned off in the stream settings, so pages aren't counted twice.sw.jsrebuilt.Tested
build-sw.js --checkpass.Generated by Claude Code