title: Google Analytics V4 API: Get data for last 30 days
body: <p>I'm playing around with the reporting api v4 from google analytics. I want to display a graph in my backend, where I show the last 30 days of some metrics. The problem is, I only get accumulated / summed values.</p>
  
  <p>For example this is a body I'm sending to the api</p>
  
  <pre><code>  body = {
      reportRequests: [{
        dateRanges: [
          {
            startDate: Date.parse('2016/10/01'),
            endDate: Date.parse('2016/10/31')
          }
        ],
        viewId: '12345',
        metrics: [{ expression: "ga:users" }],
        dimensions: [{ name: "ga:pagePath" }]
      }]
    }
  </code></pre>
  
  <p>And then I get a lot of URLs (of course, I haven't filtered the output) like this:</p>
  
  <pre><code>{"reports"=&gt;
    [{"columnHeader"=&gt;
       {"dimensions"=&gt;["ga:pagePath"],
        "metricHeader"=&gt;
         {"metricHeaderEntries"=&gt;[{"name"=&gt;"ga:users", "type"=&gt;"INTEGER"}]}},
      "data"=&gt;
       {"rows"=&gt;
         [{"dimensions"=&gt;["/"], "metrics"=&gt;[{"values"=&gt;["2854"]}]},
          {"dimensions"=&gt;["/?extlink_img=0"], "metrics"=&gt;[{"values"=&gt;["113"]}]},
          {"dimensions"=&gt;["/?v=338"], "metrics"=&gt;[{"values"=&gt;["12"]}]},
          ...
  </code></pre>
  
  <p>But how should I query the api, when I want the user count of the last 30 days, for a specific route, e.g. <code>/</code>? Is this even possible?</p>