# Access Token for REST connection to Google Analytics

**URL:** <https://connective.celigo.com/t/access-token-for-rest-connection-to-google-analytics/1339>\
**Category:** Integrator.io\
**Tags:** connection, authentication, google-analytics, users, netsuite\
**Created:** [October 29, 2020, 6:48pm UTC](https://connective.celigo.com/t/access-token-for-rest-connection-to-google-analytics/1339 "2020-10-29T18:48:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidgollom](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/davidgollom/32/6605_2.png) [@davidgollom](https://connective.celigo.com/u/davidgollom)\
**Post date:** [October 29, 2020, 6:48pm UTC](https://connective.celigo.com/t/access-token-for-rest-connection-to-google-analytics/1339/1 "2020-10-29T18:48:02Z")

</div>

Hi,

Helping a client with a google analytics to NetSuite flow. The GA export is using the REST connector. The user that created it and had access was removed from their google account and so the connection is now getting authorization failures. Any clues where to go in Google to setup a new user with access to this project? The current REST connection is setup to use Token access with refresh enabled.

Thanks.

---

<div class="post-metadata">

**Author:** ![courtneyjordan](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@courtneyjordan](https://connective.celigo.com/u/courtneyjordan)\
**Post date:** [October 29, 2020, 9:40pm UTC](https://connective.celigo.com/t/access-token-for-rest-connection-to-google-analytics/1339/2 "2020-10-29T21:40:39Z")

</div>

Hi @davidgollom,

1. In [Google Developers](https://console.developers.google.com), 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 [http://localhost.com](http://localhost.com) or [https://localhost.com](https://localhost.com).
7. Click **Create.** This will give you your **Client ID** and **Client secret**. You now have an app that will allow integrator.io to access your information. Make sure to copy these somewhere safe.
8. To get your OAuth token, use this URL: [https://accounts.google.com/o/oauth2/auth?response\_type=code&state=12121&redirect\_uri=https://localhost&client\_id=](https://accounts.google.com/o/oauth2/auth?response_type=code&state=12121&redirect_uri=https://localhost&client_id=)&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.edit https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.manage.users https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.manage.users.readonly https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.provision https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fanalytics.readonly&access\_type=offline&prompt=consent
9. Replace 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 (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 [https://accounts.google.com/o/oauth2/token.](https://accounts.google.com/o/oauth2/token.%C2%A0)

Let us know if you need more information!

---

<div class="post-metadata">

**Author:** ![davidgollom](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/davidgollom/32/6605_2.png) [@davidgollom](https://connective.celigo.com/u/davidgollom)\
**Post date:** [October 29, 2020, 9:41pm UTC](https://connective.celigo.com/t/access-token-for-rest-connection-to-google-analytics/1339/3 "2020-10-29T21:41:50Z")

</div>

Thanks. i'll give this a try.
