Redash supports a number of data sources including MongoDB, MySQL, PostreSQL & Google Analytics. In this tutorial we will integrate Google Analytics with Redash and run sample queries. Earlier we had covered Redash installation on CentOS 6.
Step 1 – Service Account Creation
- Open service account page in Google Developer Console. Select a project. If you don’t have a project, create a new project.
- Create a new service account.
- Press continue and skip the optional step to grant users access to this service account. Create key using JSON type option. Download the key and store it in a safe and secure place.
Step 2 – Enabling Analytics API
Enable Analytics API
Step 3 – Enabling API Access in Google Analytics
Note down the service account email address. The email format is quickstart@PROJECT-ID.iam.gserviceaccount.com. Add a new user in Google Analytics with this email address. This user should have Read & Analyse permission.
Step 4 – Configuring Data Source in Redash
Selection option to add Google analytics as data source. In JSON key file, select the json key downloaded in step 1.
Click on Test Connection button to test the connect.
Step 5 – Example Queries
Make sure to select analytics data source in left hand side dropdown while writing queries with google analytics as data source.