title: How to obtain Google service account access token javascript
body: <p>I'm trying to set up an analytics dashboard of my site for my leadership to view site usage. I don't want them to have to have a google account or to add them individual to see the results.</p>
  
  <p>I've set up a service account and OAuth2 access. All the tutorials I find show code like this:</p>
  
  <pre><code>gapi.analytics.auth.authorize({
    clientid: 'Service account client ID',
    serverAuth: {
        access_token: 'XXXXXXXXXXXXXXXXX'
  }
  </code></pre>
  
  <p>And all the documentation talks about "...once you recieve your access token...." But none of them actually say how to get that! I see Certificate Fingerprints, Public key fingerprints. I also see how to generate JSON and P12 keys. I don't see how to generate the access token.</p>
  
  <p>Can someone explain how to do this?</p>
  
  <p>I found <a href="https://stackoverflow.com/questions/18478764/google-analytics-api-access-with-a-service-account">this</a>. It explains that I need the key file and that it is a bad idea, but doesn't say how to actually do it.</p>
  
  <p>I also found <a href="https://stackoverflow.com/questions/28070463/google-analytics-embed-api-how-to-retireve-access-token">this</a>. But I don't know anything about Node.js and I'm hoping that is just one possible route?</p>