-1

I'm looking to expose some google analytics data to the viewers of a page on my website.

Specifically, I want to show the total number of views a page got over time, and the referral sources. (Similar to the data that Medium shows https://help.medium.com/hc/en-us/articles/215793317-Publication-stats).

Ideally, I could just plug in a component that already has the graphs rendered, but also fine with a simpler API that just gives me the data.

If Google solves this problem for me, can you point me in the right direction of how to accomplish this?

RoccoB
  • 2,439
  • 2
  • 27
  • 30

2 Answers2

1

The quickest way would be to use the Embed API with server-side authorization. The downside is that people can grab your token and run arbitrary queries against your GA view (and any other view the service account is authorized to access).

Another way (somewhat better curated) would be to use Google Apps Script to pull the required data into a spreadsheet and then (with appropriate formatting) publish this as a web app.

The third way would be to create reports in Google Data Studio and embed them into your website. Also this would not require programming (if you are comfortable with doing custom reports in GA you can use Data Studio).

I'm sure there are more ways, especially with third party tools.

Eike Pierstorff
  • 31,996
  • 4
  • 43
  • 62
0

The Google Data Studio seems to be the commonly used case in such situations

Dmitry
  • 792
  • 3
  • 17