/google-analytics-php-library

A small Wordpress plugin to send events, pageviews and e-commerce transactions to Google Analytics, using PHP / Google Measurement Protocol and a few WP functions..

Primary LanguagePHPMIT LicenseMIT

google-analytics-php-library

This is a small Wordpress plugin I cooked up in order to be able to send hits to Google Analytics, server-side, using Google Measurement Protocol. With that i'm able to send events, pageviews and transactions.

I claim no ownership on this code, as it's largely based on the work of Stu Miller : http://www.stumiller.me/implementing-google-analytics-measurement-protocol-in-php-and-wordpress/

Setup & Configuration

  • download the file and put it in the wp-content/plugins/ directory.
  • make sure you use the correct value for the GA_PROPERTY_ID constant : it has to be your Google Analytics property ID

Pull request

I'd like to keep it simple.

  • If you want to make this plugin more complete ( = add more features), then maybe fork it and make it an other project.
  • Otherwise, do not hesitate to fork / pull request if you think there are improvements to be done.