leblanc-simon / google-analytics-bundle
Add the javascript code for Google Analytics
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.5.9
- symfony/framework-bundle: ^2.8|^3
This package is auto-updated.
Last update: 2024-10-29 04:53:13 UTC
README
Description
this bundle inject the Google Analytics javascript code when an ID is defined
Installation
- install the bundle
composer require leblanc-simon/google-analytics-bundle
- activate the bundle
// app/AppKernel.php class AppKernel extends Kernel { public function registerBundles() { $bundles = [ // ... new LeblancSimon\GoogleAnalyticsBundle\LeblancSimonGoogleAnalyticsBundle(), ]; } }
Nothing else to do. The HTML will be automatically injected for the text/html response.
Customization
Configuration
you can customized the bundle with a configuration :
leblanc_simon_google_analytics: # The ID of the Google Analytics account id: Google Analytics ID # The template use in the injection template: 'LeblancSimonGoogleAnalyticsBundle::google_analytics.html.twig'
or just via parameters.yml
(think to add it in the parameters.yml.dist
) :
google_analytics.id: 'Google Analytics ID'