samuelmc / google-analytics-bundle
Google Analytics Bundle for Symfony
Installs: 64
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.5.9
- symfony/config: ^2.8||^3.0
- symfony/dependency-injection: ^2.8||^3.0
- symfony/event-dispatcher: ^2.8||^3.0
- symfony/http-foundation: ^2.8||^3.0
- symfony/http-kernel: ^2.8||^3.0
- symfony/yaml: ^2.8||^3.0
- twig/twig: ^1.0||^2.0
Requires (Dev)
- symfony/var-dumper: ~2.8|~3.0
This package is not auto-updated.
Last update: 2025-01-13 08:49:16 UTC
README
Google Analytics Bundle for Symfony
This bundle adds the Google Analytics code to every page except those that match the "exclude_path" parameter.
Installation
composer require samuelmc/google-analytics-bundle (view on packagist)
add the bundle in AppKernel:
new Samuelmc\GaBundle\SamuelGaBundle()
import the services in config.yml:
imports: - { resource: security.yml } - { resource: services.yml } ... - { resource: "@SamuelmcGaBundle/Resources/config/services.yml" }
Configuration
there are two parameters to configure under samuel_ga:
- tracking_id: your Google Analytics tracker code.
- exclude_paths: a regex string which filters out paths that should not be tracked by Google Analytics. Default: '(^/(_profiler|_wdt).+)'
samuelmc_ga: tracking_id: "UA-..." exclude_paths: '(^\/(_profiler|_wdt).+)'
##License
© Samuel Moncarey