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 Bundle

Google Analytics Bundle Laravel Package

swis/google-analytics-bundle

A Symfony bundle for integrating Google Analytics into your application. Configure your tracking ID and render the analytics JavaScript snippet from templates, making it easy to add page-view tracking without manually editing layouts.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Google Analytics Bundle
Is swis/google-analytics-bundle compatible with Laravel?
No. swis/google-analytics-bundle is a Symfony bundle that depends on Symfony's kernel, bundle registration, and DI configuration. Laravel uses Illuminate service providers and a different container lifecycle, so the bundle will not boot or configure natively in a Laravel application.
Can I install swis/google-analytics-bundle in Laravel using Composer?
Composer may install the code, but that does not make it integrated. Laravel will not register the Symfony bundle automatically, and you would need a custom bridge or to extract specific services. That adds framework coupling for a feature that is simpler to implement directly.
Does swis/google-analytics-bundle support GA4?
The bundle likely predates GA4 and may target Universal Analytics or deprecated reporting APIs. Universal Analytics properties stopped processing hits in July 2023, so any UA-only path is dead for current properties. Verify whether it supports the GA4 Data API or Measurement Protocol; assume it does not until proven otherwise.
How do I install and configure swis/google-analytics-bundle?
In Symfony, you register the bundle in bundles.php and configure the tracking ID and domain settings through the bundle configuration tree. You then render the tracking snippet with Twig helpers. There is no supported equivalent installation path for Laravel.
What should Laravel developers use instead of swis/google-analytics-bundle?
For frontend page tracking, use a controlled Blade component or tag-manager snippet with gtag.js. For GA4 reporting, evaluate spatie/laravel-analytics or the official google/analytics-data PHP SDK. For server-side events, call the GA4 Measurement Protocol through Laravel's HTTP client with timeouts, retries, and consent handling.
Is swis/google-analytics-bundle actively maintained?
Adoption signals are effectively absent: about 1 star, 0 dependents, and a low package score. That implies limited issue reporting, few community fixes, and unclear release cadence. Treat maintenance risk as high for production Laravel use.
Will swis/google-analytics-bundle work with PHP 8 and Laravel 10 or 11?
Compatibility is unclear and should be assumed poor until tested. The bundle's Symfony component constraints may conflict with current PHP or with Symfony packages pulled into a Laravel app. Even if Composer resolves dependencies, Laravel will not register the Symfony bundle at runtime.
How can I track Google Analytics events in Laravel without this bundle?
Use a Blade component to emit gtag.js events in the browser and validate consent before loading analytics. For server-side events, send GA4 Measurement Protocol requests through Laravel's HTTP client, preferably from queued jobs. Put this behind an application-owned AnalyticsTracker interface so controllers do not depend on vendor code.
What are the security and consent risks of using swis/google-analytics-bundle?
Analytics integrations touch measurement IDs, credentials, consent state, and user data. An unmaintained bundle makes consent-mode and privacy changes harder and increases exposure. Store secrets in Laravel's config and environment, not in bundle-specific configuration, and document consent flows.
Can I use swis/google-analytics-bundle as a reference for a custom Laravel integration?
Yes, as a reference implementation at most. Extract the useful concepts, but replace the Symfony coupling with a Blade component, the official Google SDK, or direct Measurement Protocol calls. Define an AnalyticsTracker or AnalyticsReporter contract owned by your Laravel application.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections