PHPackages                             sidecar/craft-analytics - 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. sidecar/craft-analytics

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

sidecar/craft-analytics
=======================

Google Analytics 4 dashboard for Craft CMS

1.0.8(3mo ago)051MITPHPPHP ^8.2

Since Mar 10Pushed 3mo agoCompare

[ Source](https://github.com/alexandreSideCar/craft-analytics)[ Packagist](https://packagist.org/packages/sidecar/craft-analytics)[ RSS](/packages/sidecar-craft-analytics/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependencies (4)Versions (10)Used By (0)

Craft Analytics
===============

[](#craft-analytics)

Google Analytics 4 dashboard plugin for Craft CMS 5.

[![Packagist Version](https://camo.githubusercontent.com/aadbeae31d76ef1e1609629578e43098ae35214df6253c0eeee30bee3bd115a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736964656361722f63726166742d616e616c7974696373)](https://camo.githubusercontent.com/aadbeae31d76ef1e1609629578e43098ae35214df6253c0eeee30bee3bd115a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736964656361722f63726166742d616e616c7974696373)[![License](https://camo.githubusercontent.com/0fce53aaace2990bd96e89ef2fe7fc0dbf85429c0b48e02489b1e63267b8f4e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736964656361722f63726166742d616e616c7974696373)](https://camo.githubusercontent.com/0fce53aaace2990bd96e89ef2fe7fc0dbf85429c0b48e02489b1e63267b8f4e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f736964656361722f63726166742d616e616c7974696373)

Features
--------

[](#features)

- **Dashboard overview** — Users, sessions, and page views for today, 7 days, and 30 days with percentage comparison vs previous period
- **Daily traffic chart** — Line chart showing users, sessions, and page views over the last 30 days
- **Top pages** — Most visited pages with title, path, views, and trend
- **Traffic sources** — Channel breakdown with doughnut chart
- **Key events** — GA4 key events (conversions) with counts and trends
- **Engagement stats** — Average session duration, bounce rate, pages per session, new vs returning users
- **Google Search Console** — Search performance data including queries, pages, clicks, impressions, CTR, and average position
- **Dashboard widget** — Compact summary widget for the Craft dashboard
- **Permissions** — Granular user permissions (View Analytics / Manage Analytics)
- **Translations** — English and French included
- **Caching** — All API responses cached (configurable duration)
- **OAuth2** — Secure connection via Google OAuth2 (no service account JSON needed)

Requirements
------------

[](#requirements)

- Craft CMS 5.3+
- PHP 8.2+
- A Google Cloud project with the **Google Analytics Data API** and **Google Search Console API** enabled
- A GA4 property
- A Search Console property (optional, for Search Console features)

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

[](#installation)

```
composer require sidecar/craft-analytics
php craft plugin/install craft-analytics
```

Or install via the Craft CMS Plugin Store.

Google Cloud Setup
------------------

[](#google-cloud-setup)

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create or select a project
3. Enable the **Google Analytics Data API** and the **Google Search Console API** (APIs &amp; Services &gt; Library)
4. Create OAuth 2.0 credentials:
    - Go to APIs &amp; Services &gt; Credentials
    - Click **Create Credentials** &gt; **OAuth client ID**
    - Application type: **Web application**
    - Add the **Authorized redirect URI** shown in the plugin settings page
5. Copy the **Client ID** and **Client Secret**

Plugin Configuration
--------------------

[](#plugin-configuration)

1. Go to **Settings &gt; Plugins &gt; Analytics** in the Craft CP
2. Enter your **GA4 Property ID** (numeric ID from GA4 Admin &gt; Property Settings, e.g. `123456789`)
3. Enter your **OAuth Client ID** and **OAuth Client Secret**
4. Click **Save**
5. Click **Connect to Google** and authorize access
6. You're connected — visit the **Analytics** section in the CP sidebar

### Environment Variables

[](#environment-variables)

All settings support environment variables:

```
GA4_PROPERTY_ID=123456789
GA4_OAUTH_CLIENT_ID=your-client-id.apps.googleusercontent.com
GA4_OAUTH_CLIENT_SECRET=your-client-secret
```

Then in plugin settings, use `$GA4_PROPERTY_ID`, `$GA4_OAUTH_CLIENT_ID`, `$GA4_OAUTH_CLIENT_SECRET`.

Permissions
-----------

[](#permissions)

The plugin registers two permissions under **Settings &gt; Users**:

PermissionDescription**View Analytics**Access the Analytics CP page and dashboard widget**Manage Analytics**Clear cache and refresh data (nested under View)Admin users always have full access. OAuth connection and plugin settings are restricted to admins only.

Cache
-----

[](#cache)

API responses are cached for 5 minutes by default. You can change this in the plugin settings (Cache Duration field). Click **Clear Cache &amp; Refresh** on the Analytics page to force a refresh.

Translations
------------

[](#translations)

The plugin ships with English and French translations. Translation files are located in `src/translations/`.

License
-------

[](#license)

MIT

Credits
-------

[](#credits)

Developed by [Side-Car](https://side-car.ca/).

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance81

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity52

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

Every ~1 days

Total

9

Last Release

100d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81d506087791c467548317cdfe4c2440ff6085c653f93e9314a64a11980dae53?d=identicon)[Side-Car](/maintainers/Side-Car)

---

Top Contributors

[![alexandreSideCar](https://avatars.githubusercontent.com/u/186958539?v=4)](https://github.com/alexandreSideCar "alexandreSideCar (13 commits)")

### Embed Badge

![Health badge](/badges/sidecar-craft-analytics/health.svg)

```
[![Health](https://phpackages.com/badges/sidecar-craft-analytics/health.svg)](https://phpackages.com/packages/sidecar-craft-analytics)
```

###  Alternatives

[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

393808.8k10](/packages/spicyweb-craft-neo)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

292943.4k27](/packages/craftcms-feed-me)[verbb/formie

The most user-friendly forms plugin for Craft.

100387.6k57](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k15](/packages/solspace-craft-freeform)[verbb/workflow

Enforce multi-step review processes for creating entries.

138123.0k1](/packages/verbb-workflow)[verbb/vizy

A flexible visual editor field for Craft.

4249.7k](/packages/verbb-vizy)

PHPackages © 2026

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