kpicaza/google-analytics-bundle

在模板中插入 Google Analytics 跟踪器的简单方法。

安装: 8

依赖项: 0

建议: 0

安全性: 0

星星: 0

关注者: 3

分支: 0

开放性问题: 0

类型:symfony-bundle

dev-master / 0.1.x-dev 2016-01-27 13:26 UTC

This package is auto-updated.

Last update: 2024-09-18 09:00:27 UTC


README

Twig 扩展,用于在模板中插入 Google Analytics 脚本

## 安装

composer require kpicaza/google-analytics-bundle=dev-master

然后在您的应用程序内核中激活

// app/AppKernel.php
class AppKernel extends Kernel
{

    public function registerBundles()
    {
        $bundles = array(    
            ...
            new Kpicaza\Bundle\GoogleanalyticsBundle\KpicazaGoogleanalyticsBundle(),
            ...

## 使用

将以下辅助函数添加到您的 twig 模板中

{{ ga_init('UA-XXXXXXXX-X') }}