title: Google Analytics API - Client Side Auth with Service account
body: <p>I'm wanting to make a Google Analytics dashboard for our company website so that marketing teams can see key website stats.  I'd like to use service account auth so that I don't have to manage permissions etc in google analytics</p>
  
  <p>This will be hosted on our "intranet" on Sharepoint, which is locked away behind microsoft login.  I've created a read-only google account as the service account.  I know that there are some potential security pitfalls with client-side auth, but I'm not too worried since this a company site with login required.</p>
  
  <p>Anyway, I'm not really sure where to start, I've been searching for hours and the closest I found was <a href="https://sharepoint.stackexchange.com/questions/136241/can-i-display-google-analytic-results-form-an-external-site-on-sharepoint/186748#186748">this post here</a>, but I cant decipher the solution and I don't have enough cred over there to comment and ask them to explain further</p>
  
  <p>I <em>think</em> I know I need the JSON key to generate a token, but I have no idea how to do that with JavaScript or even if this is the right track...</p>