2017 © Pedro Peláez
 

library googleanalytics

Nette extension - Google Analytics code

image

xruff/googleanalytics

Nette extension - Google Analytics code

  • Friday, June 30, 2017
  • by xruff
  • Repository
  • 2 Watchers
  • 0 Stars
  • 395 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 3 % Grown

The README.md

Google Analytics component for Nette Framework application

Requirements

Package requires PHP 5.6 or higher, (*1)

Installation

The best way to install XRuff/GoogleAnalytics is using Composer:, (*2)

$ composer require xruff/googleanalytics

Documentation

Configuration in config.neon. Both parameters are optional., (*3)

If parameter code is missing, GA code will not be rendered in template. If parameter user is missing, default settings will be used - value on. If paramter user is on and user is logged in, google analytics code will contain directive ga('set', 'userId', {$user->id});, (*4)

extensions:
    googleAnalytics: XRuff\App\UI\Components\DI\GoogleAnalyticsExtension

googleAnalytics:
    code: UA-123456789-1
    user: on # on/off - display user ID if user is logged in

Base presenter:, (*5)

use XRuff\App\UI\Components\IGoogleAnalyticsControlFactory;

abstract class BasePresenter extends Nette\Application\UI\Presenter
{
    /** @var IGoogleAnalyticsControlFactory $googleAnalyticsControlFactory @inject */
    public $googleAnalyticsControlFactory;

    protected function createComponentGoogleAnalytics()
    {
        return $this->googleAnalyticsControlFactory->create();
    }
}

@layout.latte:, (*6)

    ...
</head>
<body>
    {control googleAnalytics}
    ...

You can invoke parameters into control in latte template. 1st parameter is GA code. 2nd parameter should be boolean and manage displaying GA directive for user's session - ga('set', 'userId', {$user->id});. Both parameters are optioanl., (*7)

    ...
</head>
<body>
    {control googleAnalytics 'UA-123456789-2', false}
    ...

Repository https://github.com/XRuff/GoogleAnalytics., (*8)

The Versions

30/06 2017

dev-master

9999999-dev

Nette extension - Google Analytics code

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component analytics google nette ga

30/06 2017

v1.1.0

1.1.0.0

Nette extension - Google Analytics code

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component analytics google nette ga

28/04 2017

v1.0.1

1.0.1.0

Nette extension - Google Analytics code

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component analytics google nette ga

28/04 2017

1.0.0

1.0.0.0

Nette extension - Google Analytics code

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component analytics google nette ga

27/04 2017

0.0.1

0.0.1.0

Google Analytics component for Nette Framework application

  Sources   Download

GPL-3.0 BSD-3-Clause GPL-2.0

The Requires

 

The Development Requires

by Pavel Lauko

component analytics google nette ga