ash/laravel-measurement-protocol
Composer 安装命令:
composer require ash/laravel-measurement-protocol
包简介
A Laravel wrapper for Krizon's Google Analytics Measurement Protocol PHP Client.
README 文档
README
An Analytics Measurement Protocol client for Laravel. This simply provides a static interface for Krizon's PHP client.
Example
Use it just like Krizon's PHP client, but without the need to instantiate, pass a tid (this is taken from config.analytics.tid), or pass a cid (this is picked up from the _ga cookie, although it can also be manually passed).
MeasurementProtocol::event(array(
'ec' => 'Contact Form',
'ea' => 'Submit',
'ev' => 1
));
Install
Using Composer:
composer require ash/laravel-measurement-protocol:dev-master
Service Provider
Add the service provider Ash\LaravelMeasurementProtocol\LaravelMeasurementProtocolServiceProvider.
Alias
Optionally add an alias, like so:
aliases => array(
'MeasurementProtocol' => 'Ash\LaravelMeasurementProtocol\LaravelMeasurementProtocolClient'
)
Config
You'll need an Analytics config that exposes your tracking id (tid). For example, create a config file at app/config/analytics.php containing:
<?php
return array(
'tid' => 'UA-XXXXXXX-X'
);
统计信息
- 总下载量: 44
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2014-02-24