ipunkt / laravel-analytics

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

Is it possible to only display GA code when a tracking event is in the session? #32

Closed trevorgehman closed 8 years ago

trevorgehman commented 8 years ago

How would I check for the existence of an event in the session bag before rendering the GA code? The reason for this is I'm not using GA throughout, only to track one specific event and I'd rather not include GA on every page if it's not necessary.

rokde commented 8 years ago

You have to check manually right now. Maybe a service injected in the blade template would be possible.