laravel-analytics | Laravel package to retrieve pageviews | Analytics library

 by   spatie PHP Version: 4.1.1 License: MIT

kandi X-RAY | laravel-analytics Summary

laravel-analytics is a PHP library typically used in Analytics applications. laravel-analytics has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.
A Laravel package to retrieve pageviews and other data from Google Analytics
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        laravel-analytics has a medium active ecosystem.
                        summary
                        It has 2826 star(s) with 448 fork(s). There are 85 watchers for this library.
                        summary
                        There were 1 major release(s) in the last 6 months.
                        summary
                        laravel-analytics has no issues reported. On average issues are closed in 34 days. There are 1 open pull requests and 0 closed requests.
                        summary
                        It has a neutral sentiment in the developer community.
                        summary
                        The latest version of laravel-analytics is 4.1.1
                        laravel-analytics Support
                          Best in #Analytics
                            Average in #Analytics
                            laravel-analytics Support
                              Best in #Analytics
                                Average in #Analytics

                                  kandi-Quality Quality

                                    summary
                                    laravel-analytics has 0 bugs and 0 code smells.
                                    laravel-analytics Quality
                                      Best in #Analytics
                                        Average in #Analytics
                                        laravel-analytics Quality
                                          Best in #Analytics
                                            Average in #Analytics

                                              kandi-Security Security

                                                summary
                                                laravel-analytics has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                laravel-analytics code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                laravel-analytics Security
                                                  Best in #Analytics
                                                    Average in #Analytics
                                                    laravel-analytics Security
                                                      Best in #Analytics
                                                        Average in #Analytics

                                                          kandi-License License

                                                            summary
                                                            laravel-analytics is licensed under the MIT License. This license is Permissive.
                                                            summary
                                                            Permissive licenses have the least restrictions, and you can use them in most projects.
                                                            laravel-analytics License
                                                              Best in #Analytics
                                                                Average in #Analytics
                                                                laravel-analytics License
                                                                  Best in #Analytics
                                                                    Average in #Analytics

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        laravel-analytics releases are available to install and integrate.
                                                                        summary
                                                                        Installation instructions, examples and code snippets are available.
                                                                        laravel-analytics Reuse
                                                                          Best in #Analytics
                                                                            Average in #Analytics
                                                                            laravel-analytics Reuse
                                                                              Best in #Analytics
                                                                                Average in #Analytics
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi has reviewed laravel-analytics and discovered the below as its top functions. This is intended to give you an instant insight into laravel-analytics implemented functionality, and help decide if they suit your requirements.
                                                                                  • Register package .
                                                                                    • Validate that the analytics config is valid .
                                                                                      • Create a Google Client
                                                                                        • Configure the cache .
                                                                                          • Get the facade accessor .
                                                                                            • Invalid start date .
                                                                                              • Thrown when a view ID was not specified .
                                                                                                • Thrown when credentials file exists .
                                                                                                  Get all kandi verified functions for this library.
                                                                                                  Get all kandi verified functions for this library.

                                                                                                  laravel-analytics Key Features

                                                                                                  A Laravel package to retrieve pageviews and other data from Google Analytics

                                                                                                  laravel-analytics Examples and Code Snippets

                                                                                                  No Code Snippets are available at this moment for laravel-analytics.
                                                                                                  Community Discussions

                                                                                                  Trending Discussions on laravel-analytics

                                                                                                  Laravel : Countries with Laravel Analytics
                                                                                                  chevron right
                                                                                                  Using spatie/laravel-analytics, how do I get page views for a specific pagePath?
                                                                                                  chevron right
                                                                                                  How do I get View ID from Google Analytics 4?
                                                                                                  chevron right

                                                                                                  QUESTION

                                                                                                  Laravel : Countries with Laravel Analytics
                                                                                                  Asked 2021-May-14 at 13:08

                                                                                                  I'm using Laravel Analytics to get data of the visitors of my application. In my Google Analytics dashboard, every page have it own visits numbers, unique visitors, countries of visitors etc .. like in this image :

                                                                                                  In my web.php, I'm creating a route to test the package :

                                                                                                  Route::get('/data', function () {
                                                                                                      $analyticsData = Analytics::fetchMostVisitedPages(Period::days(7));
                                                                                                      dd($analyticsData);
                                                                                                  });
                                                                                                   
                                                                                                  

                                                                                                  This route returns :

                                                                                                  Illuminate\Support\Collection {#1564 ▼
                                                                                                    #items: array:3 [▼
                                                                                                      0 => array:3 [▼
                                                                                                        "url" => "/new"
                                                                                                        "pageTitle" => "test"
                                                                                                        "pageViews" => 1534
                                                                                                      ]
                                                                                                      1 => array:3 [▼
                                                                                                        "url" => "/"
                                                                                                        "pageTitle" => "test"
                                                                                                        "pageViews" => 450
                                                                                                      ]
                                                                                                      2 => array:3 [▼
                                                                                                        "url" => "/customize/8"
                                                                                                        "pageTitle" => "test"
                                                                                                        "pageViews" => 196
                                                                                                      ]
                                                                                                  

                                                                                                  As you can see the returned array have only url, pageTitle and pageViews. How can I add additional informations in the returned array such as countries or geographic localisation as shown in the first image ?

                                                                                                  ANSWER

                                                                                                  Answered 2021-May-14 at 12:21

                                                                                                  You're using spatie/laravel-analytics package. As you can see here: spatie laravel analytics - Analytics.php the fetchMostVisitedPages method that you are calling only returns that data.

                                                                                                  Please take a look in github to see more information about this package.

                                                                                                  fetchMostVisitedPages method:

                                                                                                   public function fetchMostVisitedPages(Period $period, int $maxResults = 20): Collection
                                                                                                      {
                                                                                                          $response = $this->performQuery(
                                                                                                              $period,
                                                                                                              'ga:pageviews',
                                                                                                              [
                                                                                                                  'dimensions' => 'ga:pagePath,ga:pageTitle',
                                                                                                                  'sort' => '-ga:pageviews',
                                                                                                                  'max-results' => $maxResults,
                                                                                                              ],
                                                                                                          );
                                                                                                  
                                                                                                          return collect($response['rows'] ?? [])->map(fn (array $pageRow) => [
                                                                                                              'url' => $pageRow[0],
                                                                                                              'pageTitle' => $pageRow[1],
                                                                                                              'pageViews' => (int) $pageRow[2],
                                                                                                          ]);
                                                                                                      }
                                                                                                  

                                                                                                  Source https://stackoverflow.com/questions/67534215

                                                                                                  QUESTION

                                                                                                  Using spatie/laravel-analytics, how do I get page views for a specific pagePath?
                                                                                                  Asked 2020-Nov-26 at 08:24

                                                                                                  I've just started looking at spatie/laravel-analytics, a package for getting data out of Google Analytics API. I'm a bit lost right now though as documentation seems thin... either that or I'm not searching for the right things.

                                                                                                  What I want to do feels like it should be quite simple, get page views for each day over a period for a specific URL.

                                                                                                  My current code block looks like this:

                                                                                                  $analyticsData = Analytics::performQuery(
                                                                                                      Period::days(7),
                                                                                                      'ga:pageviews',
                                                                                                      [
                                                                                                          'metrics' => 'ga:pageviews',
                                                                                                          'dimensions' => 'ga:pagePath',
                                                                                                          'filters' => 'ga:pagePath==/pasta-recipes/lasagne/'
                                                                                                      ]
                                                                                                      
                                                                                                  );
                                                                                                  var_dump($analyticsData);
                                                                                                  

                                                                                                  As always, any help appreciated.

                                                                                                  ANSWER

                                                                                                  Answered 2020-Nov-26 at 08:24

                                                                                                  In your case, just to replace this:

                                                                                                  'dimensions' => 'ga:pagePath'
                                                                                                  

                                                                                                  in:

                                                                                                  'dimensions' => 'ga:date'
                                                                                                  

                                                                                                  Output example:

                                                                                                  Source https://stackoverflow.com/questions/65004966

                                                                                                  QUESTION

                                                                                                  How do I get View ID from Google Analytics 4?
                                                                                                  Asked 2020-Oct-24 at 13:07

                                                                                                  I tried to retrieve all information about my website from GA (Google Analytics). I'm using laravel and this package https://github.com/spatie/laravel-analytics to make my life easier. However, that package requires "View ID" from GA, which I can't help myself to find it. I read this thread https://support.google.com/analytics/thread/15684521?hl=en and I'm guessing that since GA 4 they totally removed the views column from Web + App property (which will be created as a default) (correct me pls). Did anyone had this problem before? Where I can find that "view id"? are there some articles that can help me solve this problem? Any suggestion about better way to achieve my goal?

                                                                                                  ANSWER

                                                                                                  Answered 2020-Oct-24 at 09:17

                                                                                                  In GA4 there aren't Views so you if you want to use your code (who needs a View), you have to create a Universal Analytics Property.

                                                                                                  You can find it by clicking on Show advanced options (when you create a new property):

                                                                                                  Source https://stackoverflow.com/questions/64510635

                                                                                                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                                  Vulnerabilities

                                                                                                  No vulnerabilities reported

                                                                                                  Install laravel-analytics

                                                                                                  This package can be installed through Composer.

                                                                                                  Support

                                                                                                  We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products. We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
                                                                                                  Find more information at:
                                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                  Find more libraries
                                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                  Save this library and start creating your kit
                                                                                                  CLONE
                                                                                                • HTTPS

                                                                                                  https://github.com/spatie/laravel-analytics.git

                                                                                                • CLI

                                                                                                  gh repo clone spatie/laravel-analytics

                                                                                                • sshUrl

                                                                                                  git@github.com:spatie/laravel-analytics.git

                                                                                                • Share this Page

                                                                                                  share link

                                                                                                  Explore Related Topics

                                                                                                  Reuse Pre-built Kits with laravel-analytics

                                                                                                  Consider Popular Analytics Libraries

                                                                                                  superset

                                                                                                  by apache

                                                                                                  influxdb

                                                                                                  by influxdata

                                                                                                  matomo

                                                                                                  by matomo-org

                                                                                                  statsd

                                                                                                  by statsd

                                                                                                  loki

                                                                                                  by grafana

                                                                                                  Try Top Libraries by spatie

                                                                                                  laravel-permission

                                                                                                  by spatiePHP

                                                                                                  laravel-backup

                                                                                                  by spatiePHP

                                                                                                  browsershot

                                                                                                  by spatiePHP

                                                                                                  Compare Analytics Libraries with Highest Support

                                                                                                  superset

                                                                                                  by apache

                                                                                                  statsmodels

                                                                                                  by statsmodels

                                                                                                  cube.js

                                                                                                  by cube-js

                                                                                                  metrics

                                                                                                  by dropwizard

                                                                                                  micrometer

                                                                                                  by micrometer-metrics

                                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                                  Find more libraries
                                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                                  Save this library and start creating your kit