Reputation: 193
Is there a way to display the components in google analytics to my react dashboard or fetch the data and use it on my site
Below are some components from google analytics i want to use on my dashboard.
This will help admins to see the activity of the site on the dashboard
Upvotes: 1
Views: 258
Reputation: 116968
You can use the Google analytics reporting api to request the data you are looking for, I recommend looking into using a service account as it will allow you to pre authorize the account to access your analytics data. This way you will not need to use Oauth2 and authorize a user. You will however need to crate all the graphics yourself as the google analytics api only returns the data how it is displayed will be up to you. You might want to look into the chartsapi
Another option will be the Google analytics embed api this is created in Javascript so it is client sided code as such it does not support service accounts, this means that any user you want to enable to use it will have to have been granted access to your google analytics account directly in the google analytics website.
Upvotes: 1