Skip to content

Commit

Permalink
add pageview example
Browse files Browse the repository at this point in the history
  • Loading branch information
moriony committed Sep 29, 2014
1 parent 94817a7 commit fa6f0e5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions examples/pageview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

require_once __DIR__ .'/../vendor/autoload.php';

use \Moriony\Google\Analytics\MeasurementProtocol\Client;

$client = new Client([
Client::OPT_TRACKING_ID => 'UA-44411487-1',
Client::OPT_SSL => true,
]);

$response = $client->createPageView()
->setCustomerId(555)
->setDocumentHostname('example.com')
->setDocumentPath('/home')
->setTitle('Homepage')
->track();

0 comments on commit fa6f0e5

Please sign in to comment.