Skip to content

adam2k/LaravelMeasurementProtocol

This branch is 1 commit ahead of juice49/LaravelMeasurementProtocol:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

9788c4f · Mar 7, 2016

History

8 Commits
Feb 24, 2014
Mar 24, 2014
Feb 24, 2014
Mar 7, 2016
Feb 24, 2014
Feb 24, 2014
Feb 25, 2014

Repository files navigation

Laravel Measurement Protocol

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'
);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%