# Google Analytics
The Google Analytics integration can be used once a new project is created and configured in Google Console.
# Setup
- Create a new project here (opens new window)
- Click on APIs and Services (opens new window) in the side menu
- Click on Library (opens new window) in the side menu and type analytics in the search bar
- Click and enable both Google Analytics Reporting API, Google Analytics API, and Google Analytics Admin API
- Head back to the APIs and Services (opens new window) page and click on OAuth Consent Screen (opens new window) option in the side menu
- Select on either Internal or External depending on how you plan to use the integration
- You will have to fill in all the required details in the form (no need for domain yet) then continue without filling anything on the rest of the tabs
- Click on Credentials (opens new window) in the side menu, click on Create credentials, and select OAuth Client ID
- Select Web application from the dropdown list, enter any name, and in Authorized redirect URIs enter:
- http://localhost:4018/google-auth (for local use)
- https://example.com/google-auth (for production use with your domain)
- You will get a Client ID and Client Secret which you will have to use for the CB_GOOGLE_CLIENT_ID and CB_GOOGLE_CLIENT_SECRET environmental variables
- Head back to the OAuth Consent Screen (opens new window), scroll down the page, and add test users to enable certain google accounts to use the integration
- (Optional) If you want to publish the Google app, you will have to click on the "Publish app" at the top of the page (opens new window).
# Usage
To learn how to use the Google Analytics integration, you can read the tutorial on Chartbrew's blog (opens new window).
โ ๐ Deployment Webhooks โ