andreaselia / laravel-analytics

Analytics for the Laravel framework.
MIT License
165 stars 25 forks source link

Wrong unique user count #24

Closed sinnbeck closed 2 years ago

sinnbeck commented 2 years ago

The unique user count seems to be wrong. It gets the count of how many page visits the last visitor had.

Maybe do something like this to keep it simple

    'value' => PageView::query()
                    ->scopes(['filter' => [$this->period]])
                    ->groupBy('session')
                    ->pluck('session')
                    ->count(),

Let me know if you want a PR.

edit: seems this PR broke it: https://github.com/andreaselia/laravel-analytics/pull/22

tomirons commented 2 years ago

If you can push up a PR that would be fantastic!