Skip to content

PHP Interface for Sending Data to Google Analytics via the Measurement Protocol

License

Notifications You must be signed in to change notification settings

ndewhurst/gamp-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

gamp-php

PHP Interface for Sending Data to Google Analytics via the Measurement Protocol.

This is very useful for scenarios where the data you want to submit does not naturally occur in a client-side/browser/js context, and/or where the most straightforward place to capture data (events, user dimensions, etc.) is in PHP code.

Simple example usage:

$gamp = new GAMP();
$gamp->sendEvent('My Event Category', 'My Event Action', 'My Event Label');

For more info, see Google's development guide and parameter reference for the protocol.

Note: I wrote this for a Drupal website for which we were implementing GUA tracking, but plan to isolate the (minimal) Drupal-specific code and add a Drupal-specific implementation that extends a generic GAMP base.

About

PHP Interface for Sending Data to Google Analytics via the Measurement Protocol

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages