PHP Library for Google Analytics Measurement Protocol.
- PHP
- cURL
id = enter_google_analytics_id
Edit config.ini and set value of id to your Google Analytics Tracking id.
$mp = new MPPHP( $cache, $adword);
$cache boolean Enable or disable cache busting
$adword boolean Enable or disable Google Adword tracking
$mp->page( $cid, $dh, $dp, $dt, $options );
$cid Client id
$dh Document host name
$dp Document path
$dt Document title
$options array Other optional parameters.
$mp->event( $cid, $ec, $ea, $el, $ev, $options );
$cid Client id
$ec Event category
$ea Event action
$el Event label
$ev Event value
$options array Other optional parameters.
$mp->ecom_tran( $cid, $ti, $ta, $tr, $ts, $tt, $cu, $options );
$cid Client id
$ti Transaction id
$ta Transaction affilation
$tr Transaction revenue
$ts Transaction shipping
$tt Transaction tax
$cu Currency code
$options array Other optional parameters.
$mp->ecom_item( $cid, $ti, $in, $ip, $iq, $ic, $iv, $cu, $options );
$cid Client id
$ti Transaction id
$in Item name
$ip Item price
$iq Item quantity
$ic Item code
$iv Item category
$cu Currency code
$options array Other optional parameters.
$mp->social( $cid, $sa, $sn, $st, $options );
$cid Client id
$sa Social Action
$sn Social Network
$st Social Target
$options array Other optional parameters.
$mp->exception( $cid, $exd, $exf, $options );
$cid Client id
$exd Exception description
$exf Is fatal?
$options array Other optional parameters.
$mp->timing( $cid, $utc, $utv, $utt, $utl, $options );
$cid Client id
$utc Timing category
$utv Timing variable
$utt Timing time
$utl Timing label
$options array Other optional parameters.
Refer to the parameters reference for type of data allowed and optional parameners.