PHPackages                             vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2 - 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. [API Development](/categories/api)
4. /
5. vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2

ActiveLibrary[API Development](/categories/api)

vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2
============================================================

A Google Analytics realtime tile for Laravel Dashboard v2

2.0.0(5y ago)2693MITPHPPHP ^7.4

Since Oct 20Pushed 5y ago1 watchersCompare

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

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

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

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

[![Latest Version on Packagist](https://camo.githubusercontent.com/27528588c8857010bf0b636905fc74f0766da0387c4e6d87ba88366660a5a2f6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766476636f6465722f6c61726176656c2d64617368626f6172642d676f6f676c652d616e616c79746963732d7265616c74696d652d74696c652d76322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2)[![Total Downloads](https://camo.githubusercontent.com/6a42be80dc4ecb6c1a99c543cb87c00f5e7799acb1cf21bd37b9cf60876460a0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766476636f6465722f6c61726176656c2d64617368626f6172642d676f6f676c652d616e616c79746963732d7265616c74696d652d74696c652d76322e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2)

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 vdvcoder/laravel-dashboard-google-analytics-realtime-tile-v2
```

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 `\vdvcoder\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(\vdvcoder\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)
- [vdvcoder](https://github.com/vdvcoder)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

2083d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c2dfd932cd7e760f17c5bd00448480b41c79cce7d5c360669bb02aa09040c5d3?d=identicon)[vdvcoder](/maintainers/vdvcoder)

---

Top Contributors

[![vdvcoder](https://avatars.githubusercontent.com/u/13916116?v=4)](https://github.com/vdvcoder "vdvcoder (10 commits)")

---

Tags

vdvcoderlaravel-dashboard-google-analytics-realtime-tilev2

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[tomshaw/google-api

A Laravel Google API Client.

601.8k](/packages/tomshaw-google-api)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)[spatie/analytics-statistics

An opinionated php package to retrieve Google Analytics data.

794.8k](/packages/spatie-analytics-statistics)[chameleon-system/chameleon-base

The Chameleon System core.

1028.6k5](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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