kpicaza / google-analytics-bundle
Simple way to insert google analytics tracker in your templates.
Package info
github.com/kpicaza/GoogleanalyticsBundle
Type:symfony-bundle
pkg:composer/kpicaza/google-analytics-bundle
dev-master / 0.1.x-dev
2016-01-27 13:26 UTC
Requires
- php: >=5.3.0
- symfony/symfony: >=2.3
This package is auto-updated.
Last update: 2026-02-18 11:48:44 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') }}