title: Get Changes in Visits from Google Analytics Api
body: <p>I'm, trying to download some Google Analytics data from their API.
  I can download my visitors number.</p>
  <p>When you use the Google Analytics webpage you can see a percents of <em>Changes in visits</em>, but how do I get that info from their API?</p>
  <p><img src="https://i.stack.imgur.com/xhrj8.png" alt="Percents of Visits Changes" /></p>
  <p>I could try to calculate it by my self, but I have no idea of what algorithm they use.</p>
  <p>More info about the API can be found here. <a href="http://code.google.com/apis/analytics/docs/gdata/gdataExplorer.html" rel="nofollow noreferrer">Data Feed Query Explorer</a></p>
  <h1>edit</h1>
  <pre><code>Final formula
  Visits over the last 30 days
  StartDate = today.Year, today.Month - 1, today.Day
  EndDate = today.Year, today.Month, today.Day - 1
  
  
  Visits between 31 and 60 days ago
  StartDate = today.Year, today.Month - 2, today.Day
  EndDate = today.Year, today.Month -1, today.Day - 1
  </code></pre>