title: Google Analytics API (Real-time) in Google Sheets
body: <p>I'm trying to access the Google Analytics API via Google Sheets (Google Script). </p>
  
  <p>So within the script, I'm trying to use the URI as described here: <a href="https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get" rel="nofollow noreferrer">https://developers.google.com/analytics/devguides/reporting/realtime/v3/reference/data/realtime/get</a></p>
  
  <p>The API call looks something like this: </p>
  
  <p>GET <a href="https://www.googleapis.com/analytics/v3/data/realtime?ids=3254435&amp;metrics=ga%3AActiveUsers&amp;key=" rel="nofollow noreferrer">https://www.googleapis.com/analytics/v3/data/realtime?ids=3254435&amp;metrics=ga%3AActiveUsers&amp;key=</a>{YOUR_API_KEY}</p>
  
  <p>Within my Google Analytics Script, I've also created a Public API Access key: <img src="https://i.stack.imgur.com/yGzgA.png" alt="enter image description here"></p>
  
  <p>However, I can't seem to get any data whether if I'm appending the token key in the URI or within the header. </p>
  
  <p>Can any one point me to the right direction? </p>
  
  <p>Thanks</p>