Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Google Analytics Api Symfony

Google Analytics Api Symfony Laravel Package

mediafigaro/google-analytics-api-symfony

A Symfony bundle that integrates the Google Analytics API, providing configuration and services to query analytics data from your Symfony application. Simplifies authentication and reporting setup.

View on GitHub
Deep Wiki
Context7

Google Analytics API Symfony Bundle

Frequently asked questions about Google Analytics Api Symfony
How do I install mediafigaro/google-analytics-api-symfony?
Require the package with Composer and register the bundle in config/bundles.php. Expect constraints pinned to symfony/framework-bundle ^3.4|^4.0 and google/apiclient ^2.0, so resolution will likely fail on a modern Symfony or PHP 8.1+ project unless you fork with relaxed constraints. Supplying your application name, credentials and view ID in the bundle configuration completes setup.
Is this bundle compatible with Symfony 5, 6 or 7?
No. The constraint history points to symfony/framework-bundle ^3.4|^4.0 only, and release 1.2 does not change that baseline or claim PHP 8.1+ and Symfony 6/7 support. There is no published test matrix for newer framework or PHP versions. Running it on Symfony 6 or 7 means forking the bundle and maintaining it yourself.
Does this bundle work with the GA4 Data API?
No. The report request builder exposes metrics, dimensions and sorting in the Universal Analytics Core Reporting API v3 model, matching ga-dev-tools Query Explorer. UA properties stopped processing hits in July 2023 and that reporting surface is decommissioned, so release 1.2 is an enhancement to a dead endpoint rather than a GA4 migration. Queries may silently return empty result sets instead of erroring, which is the worst failure mode for a reporting pipeline.
How do I configure Google Analytics credentials for this bundle?
Credentials are supplied through the bundle configuration as OAuth2 client data or a service account JSON path, together with your app name and view (profile) ID. Bundles of this vintage often encourage a checked-in JSON file path in YAML, so verify nothing sensitive lands in version control. Prefer environment variables or Symfony secrets and treat any inherited credential config as a remediation item.
Can I inject the Google Analytics client as a service?
Yes, that is the bundle's whole purpose. Once registered, it exposes a configurable service so you can inject the ready-to-use client into controllers, commands or services without manual bootstrapping. For scheduled reporting, dashboard aggregation or ETL pulls that is a cleaner shape than wiring the official client by hand in every class.
Is this package still maintained and safe for production?
Treat it as low activity. The 1.2 release shows the repository is not entirely dormant, but roughly 46 stars, zero dependents, no changelog, no dated release metadata and no stated support commitment mean no security triage and no compatibility policy. Combined with a decommissioned API target, it is not a sound production dependency. Extract the report request builder code you need rather than adopting the package.
Can I use this bundle in a Laravel application?
No. It is a Symfony bundle that relies on symfony/framework-bundle for its configuration tree and service container integration, so Laravel has nothing to autoload. Laravel projects should use a dedicated analytics package or the official google/apiclient bound through a service provider. The report builder logic is largely framework-agnostic and could be ported if needed.
Does it support metrics, dimensions and sorting in report queries?
Release 1.2 adds metric, dimension and sort clause support matching the Query Explorer, which removes the main reason to drop to the raw client for ranked reports. Date ranges and filters are presumably part of the same builder, so confirm against the source before relying on them. None of this adds throttling, caching or backoff, so quota handling remains the caller's responsibility.
What are the alternatives to this bundle for analytics reporting in Symfony?
For GA4 data, use the official google/apiclient against the Data API runReport endpoint directly, or a maintained GA4 wrapper, and bind it in a small Symfony service you own. If you only need Query Explorer-style request building, copy the relevant classes out of this repository. For local reporting, scheduled imports into your own database plus a query layer usually beats a generic bundle.
How should I test an integration built with this bundle?
Because the client is a container service, swap it for a stub in the test container and assert on the request objects your code builds. Never hit the live API in tests, especially since a decommissioned UA endpoint can return empty data rather than an error. Cover rate-limit and failure paths explicitly, since the bundle provides no retry or backoff.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console