title: PHP Google Analytics API - Simple example
body: <p>I am trying to set some <strong>basic example</strong> of using Google Analytics with this library: <a href="https://github.com/google/google-api-php-client">https://github.com/google/google-api-php-client</a></p>
  
  <p>For starter I have:</p>
  
  <pre><code>&lt;?php
  
  require_once 'Google/Client.php';
  require_once 'Google/Service/Analytics.php';
  $client = new Google_Client();
  $client-&gt;setApplicationName("Client_Library_Examples");
  $client-&gt;setDeveloperKey("MY_SECRET_API"); //security measures
  $service = new Google_Service_Analytics($client);
  
  $results = $service-&gt;data_ga;
  
  echo '&lt;pre&gt;';
  print_r($results);
  echo '&lt;/pre&gt;';
  </code></pre>
  
  <p><strong>Q:</strong> How to get data from Google Analytics from this query ?</p>
  
  <pre><code>/*
    https://www.googleapis.com/analytics/v3/data/
    ga?ids=ga%123456
    &amp;dimensions=ga%3Acampaign
    &amp;metrics=ga%3Atransactions
    &amp;start-date=2013-12-25
    &amp;end-date=2014-01-08
    &amp;max-results=50
   */
  </code></pre>