betacie/ganalytics-bundle

Google Analytics Bundle

v0.1 2015-01-20 14:37 UTC

This package is not auto-updated.

Last update: 2024-09-11 14:38:22 UTC


README

Google Analytics bundle。有关 betacie/google-analytics 的使用,请参阅 https://github.com/betacie/google-analytics

您需要存储所有事件后再进行渲染。

// You could use tracker service in a controller or inject him in other services
// like a registration listener
$this->container->get('betacie_google.event_tracker')->trackEvent([
    'category' => 'Registration',
    'action' => 'Confirmed',
    'label' => 'user-1',
]);

所有事件存储完毕后,跟踪代码将通过 Twig 函数显示。

// Twig template
{{ google_track() }}