2017 © Pedro Peláez
 

yii2-extension yii2-google-analytics

Google Analytics (Measurement Protocol)

image

yiimaker/yii2-google-analytics

Google Analytics (Measurement Protocol)

  • Sunday, December 4, 2016
  • by YiiMaker
  • Repository
  • 3 Watchers
  • 3 Stars
  • 130 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 12 % Grown

The README.md

Google Analytics (Measurement Protocol)

Google Analytics (Measurement Protocol), (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist yiimaker/yii2-google-analytics "*"

or add, (*4)

"yiimaker/yii2-google-analytics": "*"

to the require section of your composer.json file., (*5)

Example

Initialize, (*6)

$analytics = \Yii::createObject([
    'class' => \ymaker\google\analytics\mp\Analytics::className(),

    'v' => 1,                                       // Protocol version. Default value: 1
    'tid' => 'UA-XXXX-Y'                            // Tracking ID / Web Property ID
    'cid' => '35009a79-1a05-49d7-b876-2b884d0f825b' // Client ID. Random UUID (http://www.ietf.org/rfc/rfc4122.txt)
]);

Usage, (*7)

/** @var yii\httpclient\Response $responce */
$responce = $analytics->send([
    't' => 'event',     // Hit Type.
    'ec' => 'video',    // Event Category.
    'ea' => 'play',     // Event Action.
    'el' => 'holiday',  // Event label.
    'ev' => 300,        // Event value.
]);

For more information, refer to the API official documentation., (*8)

The Versions

04/12 2016

dev-master

9999999-dev

Google Analytics (Measurement Protocol)

  Sources   Download

Apache-2.0

The Requires

 

by Ruslan Saiko

analytics extension yii2 google measurement protocol

04/12 2016

1.0.0

1.0.0.0

Google Analytics (Measurement Protocol)

  Sources   Download

Apache-2.0

The Requires

 

by Ruslan Saiko

analytics extension yii2 google measurement protocol