Google Analytics API: Finding user age bracket and gender information
<p>I'm trying to find the age bracket and gender information of my users using Google Analytics API using PHP. This is the query I tried running:</p>

<pre><code>function user_gender(&amp;$analytics, $profileId) {

  $optParams = array(
    'dimensions' =&gt; 'ga:userGender',
    );

  return $analytics-&gt;data_ga-&gt;get(
      'ga:' . $profileId,
      '30daysAgo',
      'today',
      'ga:users',
      $optParams    
    );
}
</code></pre>

<p>However, the above query doesn't return anything. I have used the <code>users</code> metric along with the <code>userGender</code> dimension. What seems to be wrong with my query?</p>