1. Go to this page and download the library: Download gradosevic/easy-ga library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
Analytics::create($config)
->event()
->setCategory('Custom Data')
->setAction('Custom Data Action')
->setLabel('Sent Custom Values')
->setCustomDimension('custom value a', 1) // Index is 1
->setCustomDimension('custom value b', 2) // Index is 2
->setValue(9) // Event value
->send();
use Gradosevic\EasyGA\Analytics;
use Gradosevic\EasyGA\Product;
Analytics::create($config)
->transaction('TransactionID-2342541')
->setProduct(Product::create('MINPRODUCT-56471', 'Min Product', 1.99))
->sendPurchase();
Analytics::create($config)
// Using Easy GA Event constructor to pass data
->event('Advanced Event Group', 'Advanced Event Action')
// Using Easy GA class methods
->setLabel('Event wcd label')
// The moment when we switch to API
->api()
// Using API method
->setDocumentReferrer('referrer.com')
// Using API method
->setDocumentPath('/event/document/path')
// Important: We can not use Easy GA send() method any more.
// We have to use API send method now.
->sendEvent();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.