PHP code example of clippings / php-gacx
1. Go to this page and download the library: Download clippings/php-gacx 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/ */
clippings / php-gacx example snippets
use UnitedPrototype\GoogleAnalytics;
$experiment = new GoogleAnalytics\Experiment('reBreiK2QpOws-pJlkla1o');
$variation = $experiment->chooseVariation();
js
// Hand over experiment data to analytics.js, as it ignores the "__utmx" cookie
window.gaData = {
expId: '<?= $experiment->getId();