davefu / google-analytics
Component for Google Analytics code
v2.0
2014-09-20 15:45 UTC
Requires
- nette/nette: 2.1.*
This package is not auto-updated.
Last update: 2024-12-17 02:38:42 UTC
README
This is Google Analytics component for Nette Framework.
Instalation
Include extension in config.neon and add Google Analytics key (if key is not defined, GA script will not be printed):
analytics:
key: "UA-XXXXXXXX-X"
extensions:
analytics: davefu\GoogleAnalytics\DI\AnalyticsExtension
Usage
You have to insert component factory to BasePresenter and use the component in @layout.latte:
/** @var \davefu\GoogleAnalytics\Components\GoogleAnalyticsFactory\GoogleAnalyticsFactory @inject */ protected $googleAnalyticsFactory; public function createComponentAnalytics() { return $this->googleAnalyticsFactory->create(); }