kreativan
3/8/2019 - 12:47 PM

Processwire Google Analytics Tracking

Processwire Google Analytics Tracking

<?php
$test_url = "https://ga-dev-tools.appspot.com/hit-builder/";

$http = new WireHttp();
$http->post('http://www.google-analytics.com/collect', [ // Make sure to use HTTP, not HTTPS!
  'v' => 1, // Version
  'tid' => 'your-tracking-id', // Tracking ID / Property ID.
  'cid' => 555, // Anonymous Client ID.
  't' => 'event', // hit type
  'ec' => 'myEventCategory', // category
  'ea' => 'myEventAction', // action
  'el' => 'myEventLabel', // label
]);