Skip to content

tracker: add localhost tracking configuration#217

Merged
stordahl merged 3 commits intomainfrom
stordahl/configure-local-host
Aug 25, 2025
Merged

tracker: add localhost tracking configuration#217
stordahl merged 3 commits intomainfrom
stordahl/configure-local-host

Conversation

@stordahl
Copy link
Copy Markdown
Collaborator

@stordahl stordahl commented Aug 23, 2025

Overview

Closes #50

  • adds a new boolean option to Counterscale.init named reportOnLocalhost (defaults to false) that enables/disables collecting events when the page is localhost, or any local IP address
  • for those using the tracker script, add a data-report-localhost to the tracker's script tag to enable tracking on localhost
    • If using a templating engine like JSX, you can use booleans to conditionally enable reporting on localhost via the tracker script (ie data-report-localhost={isDev ? true : false }

@stordahl stordahl marked this pull request as ready for review August 23, 2025 22:14
@stordahl stordahl marked this pull request as draft August 23, 2025 22:21
@codecov
Copy link
Copy Markdown

codecov bot commented Aug 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.41%. Comparing base (d9d6cb2) to head (1a151bf).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   78.35%   78.41%   +0.05%     
==========================================
  Files          51       51              
  Lines        3941     3951      +10     
  Branches      520      524       +4     
==========================================
+ Hits         3088     3098      +10     
  Misses        844      844              
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stordahl stordahl force-pushed the stordahl/configure-local-host branch from e37f581 to 1a151bf Compare August 24, 2025 01:18
@stordahl stordahl marked this pull request as ready for review August 24, 2025 01:38
Copy link
Copy Markdown
Owner

@benvinegar benvinegar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@stordahl stordahl merged commit ed1cf68 into main Aug 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reject stats from localhost by default

2 participants