Access Token for REST connection to Google Analytics



  • Courtney Jordan Experience Strategy & Design Director Community moderator
    Celigo University Level 4: Legendary
    Awesome Follow-up
    Top Contributor

    Hi David Gollom,

    1. In Google Developers, you'll need to enable access to Analytics for your project. You'll need to do this twice as there are 2 sets of APIs to add: Google Analytics API and Google Analytics Reporting API. In API & Services, go to Library > API Library.
    2. Go to Credentials > Create Credentials. From the Create credentials drop-down button, choose OAuth client ID. Click the Configure consent screen button if necessary (if you don't already have your application added).
    3. If you already have your app, skip to step 6. If not, specify the Application name and Support email values.
    4. Click the Add scope button. Select all of the scopes, then Save
    5. Create your OAuth client ID. In the Create OAuth client ID page, choose Web application, then specify the Name.
    6. In the Authorized redirect URIs section, specify either or
    7. Click Create. This will give you your Client ID and Client secret. You now have an app that will allow to access your information. Make sure to copy these somewhere safe.
    8. To get your OAuth token, use this URL:<client_id>&
    9. Replace <client_id> with the Client ID you created in step 7. Remove the brackets. 
    10. Copy the URL string and paste it into your browser. You'll be prompted to choose the account to sign in with. Choose the account, then click Allow. If you get a uri_redirect error, make sure that after localhost in the URL, there is no forward slash (/).
    11. You'll get a "This app isn't verified" error. Click the Advanced link, then click to Go to <your app name> (unsafe) link at the bottom of the dialog.
    12. You'll need to click Allow for each of the scopes you selected earlier.
    13. When this is done, you should be directed to your localhost URL. Copy the e URL up to the end of the code value and put it somewhere safe. Don't include the & after the code value in the URL.
    14. You've already got an OAuth token, but the next step would be to generate an OAuth token (such as in Postman) using 

    Let us know if you need more information!

  • David Gollom Strategic Partner
    Top Contributor
    Celigo University Level 4: Legendary
    Answer Pro
    Great Answer

    Thanks. i'll give this a try. 


Please sign in to leave a comment.