ipunkt / laravel-analytics

Analytics tracking package for Laravel
MIT License
263 stars 54 forks source link

disable via config #57

Closed lsmith77 closed 4 years ago

lsmith77 commented 5 years ago

I would like to disable GA tracking in feature branches.

I am using platform.sh for hosting where I can deploy every feature branch and there I can set env variables for each deployment. For staging I will use a different tracking ID but for feature branches this isn't really feasible or sensible.

So I basically still want any method call to work but it should not add the GA javascript and any call to the PHP API should not communicate with GA.

Would you be open to a PR that implements?

I would basically add a disabled key to the configuration

rokde commented 4 years ago

This is already implemented. Just set ANALYTICS_PROVIDER in your environment or analytics.provider config entry to NoAnalytics and you are done.

The NoAnalytics Provider is a Null-Pattern implementation, so everything works fine - like in tests useful.

lsmith77 commented 4 years ago

thx!