kpicaza / google-analytics-bundle
Simple way to insert google analytics tracker in your templates.
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.0
- symfony/symfony: >=2.3
This package is auto-updated.
Last update: 2024-12-18 09:28:04 UTC
README
Twig extension to insert Google Analytics script in your templates
##Installation:
composer require kpicaza/google-analytics-bundle=dev-master
Then activate in your app kernel
// app/AppKernel.php
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new Kpicaza\Bundle\GoogleanalyticsBundle\KpicazaGoogleanalyticsBundle(),
...
##Usage:
Add the following helper function to your twig template:
{{ ga_init('UA-XXXXXXXX-X') }}