tomasz-rup / sf-gemius-traffic-plugin
symfony 1.x 插件,用于添加 Gemius 集成
1.0.0
2017-10-05 09:58 UTC
Requires
This package is auto-updated.
Last update: 2024-09-29 04:42:56 UTC
README
轻松将Gemius 流量跟踪代码添加到您的表现层。
安装
-
安装插件
$ composer require tomasz-rup/sf-gemius-traffic-plugin
-
将
sfGemiusTrafficFilter添加到您的过滤器链中rendering: ~ security: ~ # insert your own filters here gemius_traffic: class: sfGemiusTrafficFilter cache: ~ common: ~ execution: ~
配置
-
在您的应用程序的
app.yml文件中启用插件all: gemius_traffic_plugin: enabled: true
-
可选地设置 Gemius 流量代码的位置
all: gemius_traffic_plugin: insertion: <?php echo sfGemiusTrafficTracker::POSITION_HEAD ?>
注意:
POSITION_HEAD是默认位置。 -
在
module.yml中设置动作标识符all: index: gemius_traffic: params: identifier: 4re4r.4s4d55d2r5ff5.g1
或设置模块标识符
all: gemius_traffic: params: identifier: 4re4r.4s4d55d2r5ff5.g1
插入位置
-
POSITION_HEAD插入到
<head>中 -
POSITION_BODY_TOP作为
<body>中的第一个元素插入 -
POSITION_BODY_BOTTOM
作为<body>中的最后一个元素插入
注意
插件代码是基于sfGoogleAnalyticsPlugin分支的。