GitXplorerGitXplorer
K

GoogleAnalyticsBundle

public
1 stars
1 forks
0 issues

Commits

List of commits on branch master.
Unverified
f2c5c0bbcb9d9cf83aa7e15efe8a47d45b29d192

Merge pull request #2 from micronax/patch-2

KKeKs0r committed 11 years ago
Unverified
b15ab6eeb2985d6031e0931c6dd203d118ee0ecd

Merge pull request #1 from micronax/patch-1

KKeKs0r committed 11 years ago
Unverified
d751fd5bb0892571f97f970da3902f026546c809

Update README.md

mmicronax committed 11 years ago
Unverified
c98fba09e1b82b6e502a6dd46b77858ab79f1d83

Update README.md

mmicronax committed 11 years ago
Unverified
6e63fbaceb12fb03cdc7b5fcf96448b9543bf89a

ecommerce fix

KKeKs0r committed 12 years ago
Unverified
57135ab35e3de1beae77dbf9733ac6562d9766ea

FixemALl

KKeKs0r committed 12 years ago

README

The README file for this repository.

Analytics GoogleBundle

This is based on the original AntiMattr/GoogleBundle. It is solely for Analytics using the Universal Analytics API

Installation

Application Kernel

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

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:

    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).

With twig:

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

Usage

Manually trigger an PageView

Just get the analytics service in your controller via:

$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);