How To Get An OAuth Client ID From Google
Creating an OAuth Client ID for the Google Analytics API is easy and only takes a few minutes.
Just follow the links for these three steps:
1. Enable the Google Analytics API
Click the "Enable" button to enable the Google Analytics API. Move to the next step if it's already enabled.
2. Set up OAuth consent
If you're just testing things out, this consent info isn't super important yet.
- At a minimum, include the following:
- Application name
- Support email
- Add this scope:
View your Google Analytics data
- Authorized domains
- Application Homepage link
- Application Privacy Policy link
- Then click Save
You can now create a Client ID, but users will see a security warning until your OAuth consent info is verified by Google.
According to Google, development/testing projects or projects which are not yet live to the public are ineligible for verification, so feel free to do that later.
3. Create new "Web application" credentials
Give it a name and be sure to specify the domain origins where you'll be using it from (including localhost:port
if testing locally). You can always add/remove domain origins later.
Your Client ID is ready!
You can find it at any time by visiting API credentials. This is also where you'll go to add/remove domain origins from your credentials.
Your OAuth Client ID should look something like the following:
1234567897441-uqe824vvuhc82t9ilovetacos69p5r79.apps.googleusercontent.com