-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
35 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,47 @@ | ||
# Very short description of the package | ||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/akki-io/laravel-google-analytics/master/images/hero.png" alt="Hero" width="600"> | ||
</p> | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/akki-io/laravel-google-analytics.svg?style=flat-square)](https://packagist.org/packages/akki-io/laravel-google-analytics) | ||
[![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) | ||
![GitHub Actions](https://github.com/akki-io/laravel-google-analytics/actions/workflows/main.yml/badge.svg) | ||
# Laravel Google Analytics | ||
|
||
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors. | ||
[![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) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
[![StyleCI](https://styleci.io/repos/441735142/shield?branch=master)](https://styleci.io/repos/441735142) | ||
[![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) | ||
|
||
## Installation | ||
A Laravel package to retrieve data from Google Analytics 4 using the GA4 Query Explorer | ||
|
||
You can install the package via composer: | ||
## TL;DR | ||
|
||
```bash | ||
composer require akki-io/laravel-google-analytics | ||
``` | ||
Using this package you can easily retrieve data from Google Analytics 4. | ||
|
||
## Usage | ||
Below are some examples. | ||
|
||
```php | ||
// Usage description here | ||
``` | ||
|
||
### Testing | ||
|
||
```bash | ||
composer test | ||
use AkkiIo\LaravelGoogleAnalytics\Facades\LaravelGoogleAnalytics; | ||
use AkkiIo\LaravelGoogleAnalytics\Period; | ||
use Google\Analytics\Data\V1beta\Filter\StringFilter\MatchType; | ||
use Google\Analytics\Data\V1beta\MetricAggregation; | ||
use Google\Analytics\Data\V1beta\Filter\NumericFilter\Operation; | ||
|
||
// get the top 20 viewed pages for last 30 days | ||
LaravelGoogleAnalytics::getTopViewedPages(Period::days(30), $count = 20); | ||
|
||
// build a query using the `get()` method | ||
LaravelGoogleAnalytics::dateRanges(Period::days(30), Period::days(60)) | ||
->metrics('active1DayUsers', 'active7DayUsers') | ||
->dimensions('browser', 'language') | ||
->metricAggregations(MetricAggregation::TOTAL, MetricAggregation::MINIMUM) | ||
->whereDimension('browser', MatchType::CONTAINS, 'firefox') | ||
->whereMetric('active7DayUsers', Operation::GREATER_THAN, 50) | ||
->orderByDimensionDesc('language') | ||
->get(); | ||
``` | ||
|
||
### Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. | ||
Please refer to the [wiki]((https://github.com/akki-io/laravel-google-analytics/wiki)) for more details. | ||
|
||
|
||
## Contributing | ||
|
||
|
@@ -40,13 +53,9 @@ If you discover any security related issues, please email [email protected] instead | |
|
||
## Credits | ||
|
||
- [Akki Khare](https://github.com/akki-io) | ||
- [All Contributors](../../contributors) | ||
- [Akki Khare](https://github.com/akki-io) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
|
||
## Laravel Package Boilerplate | ||
|
||
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.