PHPackages                             ingoldsby/laravel-dashboard-google-analytics-realtime-tile - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ingoldsby/laravel-dashboard-google-analytics-realtime-tile

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ingoldsby/laravel-dashboard-google-analytics-realtime-tile
==========================================================

A Google Analytics realtime tile for Laravel Dashboard

1.0.0(6y ago)191977[2 issues](https://github.com/ingoldsby/laravel-dashboard-google-analytics-realtime-tile/issues)MITPHPPHP ^7.4CI failing

Since Jun 9Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ingoldsby/laravel-dashboard-google-analytics-realtime-tile)[ Packagist](https://packagist.org/packages/ingoldsby/laravel-dashboard-google-analytics-realtime-tile)[ Docs](https://github.com/ingoldsby/laravel-dashboard-google-analytics-realtime-tile)[ RSS](/packages/ingoldsby-laravel-dashboard-google-analytics-realtime-tile/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

A tile to display Google Analytics realtime information
=======================================================

[](#a-tile-to-display-google-analytics-realtime-information)

[![Latest Version on Packagist](https://camo.githubusercontent.com/2070457fbf325237668646b2ee4bd44ba909f21295e0040c04cfee1c37de6d88/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696e676f6c647362792f6c61726176656c2d64617368626f6172642d676f6f676c652d616e616c79746963732d7265616c74696d652d74696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ingoldsby/laravel-dashboard-google-analytics-realtime-tile)[![Total Downloads](https://camo.githubusercontent.com/7f12fd5ce958b023f629211e1a8f8953f9c2f8d5596aee2fe43a97b081712cad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696e676f6c647362792f6c61726176656c2d64617368626f6172642d676f6f676c652d616e616c79746963732d7265616c74696d652d74696c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ingoldsby/laravel-dashboard-google-analytics-realtime-tile)

This tile can be used on [the Laravel Dashboard](https://docs.spatie.be/laravel-dashboard) to display Google Analytics realtime information.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require ingoldsby/laravel-dashboard-google-analytics-realtime-tile
```

Google Analytics credentials
----------------------------

[](#google-analytics-credentials)

Before using this tile you need to ensure you have the correct credentials on your system. Follow the instructions on [Real Time Reporting API Overview](https://developers.google.com/analytics/devguides/reporting/realtime/v3) to sign up to access the API. When access is granted:

1. Enable the Google Analytics API.
2. Create a [Service Account](https://developers.google.com/identity/protocols/oauth2/service-account) with appropriate permissions.
3. Navigate to the Service Account and add a new JSON private key. A JSON file will be downloaded - rename this to 'analytics-credentials.json' and move it to your root Laravel directory.

Make note of the 'Service Account ID' that is generated. It will follow the format of "&lt;service\_account\_name&gt;@.iam.gserviceaccount.com".

Google Analytics view
---------------------

[](#google-analytics-view)

Access [Google Analytics](https://analytics.google.com/analytics) and navigate to the required view (e.g. Account &gt; Properties &amp; Apps &gt; View). Make note of the 'View ID' that is displayed underneath the view name. Click on 'View User Management' and add a new user. The email address is the Service Account ID that was used in the Google Analytics credentials step.

More information is available on the [Real Time Reporting API Developer Guide](https://developers.google.com/analytics/devguides/reporting/realtime/v3/devguide). Also take into account your [quotas and limits on API Requests](https://developers.google.com/analytics/devguides/config/mgmt/v3/limits-quotas).

Usage
-----

[](#usage)

In the `dashboard` config file, you must add this configuration in the `tiles` key.

1. Enter the view ID that you wish to gather information for e.g. 123456789.
2. If you changed the name and/or location of the analytics credentials JSON from suggested below, update the field.
3. The number of URLs displayed on the URLs tile can be limited by amending the `urls_displayed` field, with a default value of 10.
4. The `active users` tile can have the background changed depending upon a threshold of how many active users you set. If the `active_users_warning_threshold` field is not in the settings, there will be no threshold and no change to the background. Setting to a value of 0 would use the warning background when there are 0 active users. Setting to a value of 10 would use the warning background when there are 10 or fewer active users.

```
// in config/dashboard.php

return [
    // ...
    'tiles' => [
        'google_analytics_realtime' => [
            'view_id' => '123456789',
            'key_file_location' => __DIR__ . '/../analytics-credentials.json',
            'urls_displayed' => 4,
            'active_users_warning_threshold' => 0,
        ]
    ],
];
```

In `app\Console\Kernel.php` you should schedule the `\Ingoldsby\GoogleAnalyticsRealtimeTile\Commands\FetchGoogleAnalyticsRealtimeCommand` to run every minute, pending your Google API quotas and limits.

```
// in app/console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // ...
    $schedule->command(\Ingoldsby\GoogleAnalyticsRealtimeTile\Commands\FetchGoogleAnalyticsRealtimeCommand::class)->everyMinute();
}
```

In your dashboard view you can use three separate tiles:

- `livewire:google-analytics-realtime-active-users-tile`
- `livewire:google-analytics-realtime-devices-tile`
- `livewire:google-analytics-realtime-urls-tile`

```

```

The layout above will produce something similar to:

[![Dashboard tiles](https://user-images.githubusercontent.com/26500496/84089697-05779b00-aa33-11ea-86e3-e2d4da80fc6b.png)](https://user-images.githubusercontent.com/26500496/84089697-05779b00-aa33-11ea-86e3-e2d4da80fc6b.png)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email instead of using the issue tracker.

Support Spatie
--------------

[](#support-spatie)

I have learnt a lot from Spatie's various packages, including [Mailcoach](https://mailcoach.app), and would recommend you check them out if you want to know more.

Learn how to create a package like this one, by watching Spatie's premium video course:

[![Laravel Package training](https://camo.githubusercontent.com/4c7f3720a29525e627f6004ee367e55def510e45d18e6bc974725812fa5cf257/68747470733a2f2f7370617469652e62652f6769746875622f7061636b6167652d747261696e696e672e6a7067)](https://laravelpackage.training)

Spatie invest a lot of resources into creating [best in class open source packages](https://spatie.be/open-source). You can support them by [buying one of their paid products](https://spatie.be/open-source/support-us).

Credits
-------

[](#credits)

- [Ingoldsby](https://github.com/ingoldsby)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2214d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/66962c309dbebc0729e060b3062fd0fa0871a7d9bcd32ec79ca405f730690b60?d=identicon)[ingoldsby](/maintainers/ingoldsby)

---

Tags

ingoldsbylaravel-dashboard-google-analytics-realtime-tile

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ingoldsby-laravel-dashboard-google-analytics-realtime-tile/health.svg)

```
[![Health](https://phpackages.com/badges/ingoldsby-laravel-dashboard-google-analytics-realtime-tile/health.svg)](https://phpackages.com/packages/ingoldsby-laravel-dashboard-google-analytics-realtime-tile)
```

###  Alternatives

[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[aimeos/laravel-analytics-bridge

Unified analytics bridge for Laravel

1652.1k9](/packages/aimeos-laravel-analytics-bridge)[voidagency/vactory_starter_kit

Vactory is a custom Drupal profile which is developed and released by VOID Agency.

1021.6k](/packages/voidagency-vactory-starter-kit)[spatie/laravel-dashboard-time-weather-tile

A tile for Laravel Dashboard that displays the time and the weather

1112.5k1](/packages/spatie-laravel-dashboard-time-weather-tile)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
