plausible-tracker icon indicating copy to clipboard operation
plausible-tracker copied to clipboard

feat: add an enabled flag to options

Open btkostner opened this issue 4 years ago • 3 comments

Description

This adds an enabled bool option that would disable sending any events to Plausible, but keep all functions working.

Related Issue

Fixes https://github.com/plausible/plausible-tracker/issues/9

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [X] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • [X] My code follows the code style of this project.
  • [X] My change requires a change to the documentation.
  • [X] I have updated the documentation accordingly.
  • [X] I have read the CONTRIBUTING document.
  • [X] I have added tests to cover my changes.
  • [X] All new and existing tests passed.

btkostner avatar Feb 16 '21 18:02 btkostner

Codecov Report

:exclamation: No coverage uploaded for pull request base (master@a5f8e94). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             master       #10   +/-   ##
==========================================
  Coverage          ?   100.00%           
==========================================
  Files             ?         2           
  Lines             ?        68           
  Branches          ?        18           
==========================================
  Hits              ?        68           
  Misses            ?         0           
  Partials          ?         0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update a5f8e94...b4d9f8b. Read the comment docs.

codecov[bot] avatar Feb 16 '21 18:02 codecov[bot]

Sorry I didn't have notifications on for this repository...

LGTM. @Maronato do you have any comments?

ukutaht avatar Feb 23 '21 14:02 ukutaht

This would be quite useful if someone uses trackEvent() or trackPageview() functions throughout their codebase and wants to disable Plausible analytics for development, staging, or testing environments, without having to wrap the functions to ensure they're always available.

priithansen avatar Jun 20 '23 17:06 priithansen