title: getting a google analytics access token and how to use it in google sheets script
body: <p>I am currently pulling data from the API query URI from the query explorer from google. <a href="https://ga-dev-tools.appspot.com/query-explorer/" rel="nofollow noreferrer">https://ga-dev-tools.appspot.com/query-explorer/</a> It's possible here to include a 60 minute access token.</p>
  
  <p>Now I want a non expiring access token and gotten as far as the API Project website from google and I have generated a client id and secret.</p>
  
  <p>I tried to add the client_id and client_secret as parameters to the url like so:
  url&amp;client_id=xxx&amp;client_secret=yyy</p>
  
  <p>This does not work. </p>
  
  <p>How can I generate a working access token in Google (Sheets) scripts? </p>
  
  <p>Thanks</p>