2017 © Pedro Peláez
 

symfony-bundle google-bundle

Bundle to use the Universal Analytics Google API

image

strego/google-bundle

Bundle to use the Universal Analytics Google API

  • Monday, June 23, 2014
  • by maxpowel
  • Repository
  • 1 Watchers
  • 1 Stars
  • 37 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Analytics GoogleBundle

This is based on the original AntiMattr/GoogleBundle. It is solely for Analytics using the Universal Analytics API, (*1)

Installation

Application Kernel

Add GoogleBundle to the registerBundles() method of your application kernel:, (*2)

public function registerBundles()
{
    return array(
        new Strego\GoogleBundle\StregoGoogleBundle(),
    );
}

Configuration

Google Analytics

Application config.yml

Enable loading of the Google Analytics service by adding the following to the application's config.yml file:, (*3)

    strego_google:
        default_tracker: default
        trackers:
            default:
                accountId: xXxxXx
                cookieDomain: .example.com

Full Configugarion Reference

    strego_google:
        default_tracker: default
        trackers:
            default:
                accountId: xXxxXx
                cookieDomain: .example.com
                allowHash: false
                allowLinker: true
                trackPageLoadTime: false

View

Include the Google Analytics Async template in the head tag or just before the </body> of your layout (The template will lazy load ga)., (*4)

With twig:, (*5)

{% include "StregoGoogleBundle:Analytics:async.html.twig" %}

Usage

Manually trigger an PageView

Just get the analytics service in your controller via:, (*6)

$analytics = $this->get('strego_google');

// To add just a pageview:
$analytics->addPageView('/testPage');

//To add a Pageview with a specific title
$analytics->addPageView('/testPage2', 'testPage2Title);

The Versions

23/06 2014

dev-master

9999999-dev

Bundle to use the Universal Analytics Google API

  Sources   Download

MIT

The Requires

 

The Development Requires

analytics google universal analytics