{"id":19451695,"url":"https://github.com/akki-io/laravel-google-analytics","last_synced_at":"2025-09-10T23:47:13.492Z","repository":{"id":43845861,"uuid":"458709978","full_name":"akki-io/laravel-google-analytics","owner":"akki-io","description":"A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer","archived":false,"fork":false,"pushed_at":"2024-05-29T15:37:32.000Z","size":12426,"stargazers_count":46,"open_issues_count":1,"forks_count":23,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T20:05:47.743Z","etag":null,"topics":["google-analytics","google-analytics-4","google-analytics-query-explorer","laravel","php"],"latest_commit_sha":null,"homepage":"https://github.com/akki-io/laravel-google-analytics/wiki","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akki-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-13T04:35:07.000Z","updated_at":"2025-03-24T08:20:02.000Z","dependencies_parsed_at":"2023-02-10T05:16:04.558Z","dependency_job_id":"58ccc548-8ba0-4cec-af86-4031f18824bd","html_url":"https://github.com/akki-io/laravel-google-analytics","commit_stats":{"total_commits":31,"total_committers":5,"mean_commits":6.2,"dds":0.4193548387096774,"last_synced_commit":"9eceb732f8bdb942a6b2446a755a868dd41a28ef"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-google-analytics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-google-analytics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-google-analytics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akki-io%2Flaravel-google-analytics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akki-io","download_url":"https://codeload.github.com/akki-io/laravel-google-analytics/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112225,"owners_count":21049619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-analytics","google-analytics-4","google-analytics-query-explorer","laravel","php"],"created_at":"2024-11-10T16:42:42.860Z","updated_at":"2025-04-09T21:20:13.602Z","avatar_url":"https://github.com/akki-io.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/akki-io/laravel-google-analytics/master/images/hero.png\" alt=\"Hero\" width=\"600\"\u003e\n\u003c/p\u003e\n\n# Laravel Google Analytics\n\n[![Latest Version](https://img.shields.io/github/release/akki-io/laravel-google-analytics.svg?style=flat-square)](https://github.com/akki-io/laravel-google-analytics/releases)\n![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/akki-io/laravel-google-analytics/test.yml?branch=master\u0026style=flat-square)\n[![StyleCI](https://styleci.io/repos/441735142/shield?branch=master)](https://styleci.io/repos/441735142)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)\n[![Total Downloads](https://img.shields.io/packagist/dt/akki-io/laravel-google-analytics.svg?style=flat-square)](https://packagist.org/packages/akki-io/laravel-google-analytics)\n\n\nA Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer\n\n## TL;DR\n\nUsing this package you can easily retrieve data from Google Analytics 4.\n\nBelow are some examples.\n\n```php\n\nuse AkkiIo\\LaravelGoogleAnalytics\\Facades\\LaravelGoogleAnalytics;\nuse AkkiIo\\LaravelGoogleAnalytics\\Period;\nuse Google\\Analytics\\Data\\V1beta\\Filter\\StringFilter\\MatchType;\nuse Google\\Analytics\\Data\\V1beta\\MetricAggregation;\nuse Google\\Analytics\\Data\\V1beta\\Filter\\NumericFilter\\Operation;\n\n// get the top 20 most viewed pages for last 30 days\nLaravelGoogleAnalytics::getMostViewsByPage(Period::days(30), $count = 20);\n\n// get the top 20 dates with most users for last 12 months\nLaravelGoogleAnalytics::getMostUsersByDate(Period::months(12), $count = 20);\n\n// build a query using the `get()` method\nLaravelGoogleAnalytics::dateRanges(Period::days(30), Period::days(60))\n    -\u003emetrics('active1DayUsers', 'active7DayUsers')\n    -\u003edimensions('browser', 'language')\n    -\u003emetricAggregations(MetricAggregation::TOTAL, MetricAggregation::MINIMUM)\n    -\u003ewhereDimension('browser', MatchType::CONTAINS, 'firefox')\n    -\u003ewhereMetric('active7DayUsers', Operation::GREATER_THAN, 50)\n    -\u003eorderByDimensionDesc('language')\n    -\u003eget();\n```\n\n\nPlease refer to the [wiki](https://github.com/akki-io/laravel-google-analytics/wiki) for more details.\n\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email hello@akki.io instead of using the issue tracker.\n\n## Credits\n\n- [Akki Khare](https://github.com/akki-io)\n- [All Contributors](../../contributors)\n- [spatie/laravel-analytics](https://github.com/spatie/laravel-analytics)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakki-io%2Flaravel-google-analytics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakki-io%2Flaravel-google-analytics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakki-io%2Flaravel-google-analytics/lists"}