Google Analytics Stats page from OpenPerf
In order to access the site's google analytics data, you need to create a service account and provide read access in GA.
Refer Service accounts for more details.
- Create a project in console.developers.google.com
- Open IAM Settings -> Credentials -> Service Account
- Create a service account. On creating a service account, You'll receive the private key and client email.
- Add both to environment variables
- Open analytics.google.com and navigate to Admin, to provide read permissions for the generated client email.
PRIVATE_KEY=
CLIENT_EMAIL=
VIEW_ID=
SITENAME=
GA=
Property | Description |
---|---|
PRIVATE_KEY | Key for the Service account |
CLIENT_EMAIL | Email assigned for the service account |
VIEW_ID | View ID for the Google Analytics Property |
SITENAME | Name of the site - string |
GA | UA ID for this page - optional |
Since the project uses NextJS under the hood, Vercel is the ideal platform to deploy the project. If you'd like to deploy it elsewhere, check this out.
In order to run the project locally, clone the repository and create .env
file with the environment variables mentioned above. And start the server.
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
Head over to OpenPerf to get your custom dashboard without any setup.
Project by apvarun