3
votes

My situation is the following. I have a huge amount of analytics in Google Analytics and my PostgresSQL database and I want to embed this on my dashboard.

The Data in GA looks like the following:

{ category: 'Shop Metrics', action: 'Some button clicked', label: 'shopId=' }

What I want to do now is to show every shop-owner only the events that fit to his specific SHOP-ID on our dashboard.

Now, is it possible to pass in this SHOP-ID to filter the information on demand?

If not, can you recommend any other free solution?

1
You could use the [Analytics Reporting API V4][1]. Pulling the information that you need into a dataframe and mix this data with your PostgresSQL creating subsets of data for Datastudio, remember that the max size for each is ~70MB. Or you can use something like Apache superset and have no limitations. [1]: developers.google.com/analytics/devguides/reporting/core/…F. Leone

1 Answers

3
votes

I answered the question at this reddit thread.

---- Original Answer ----

Yes. Using a Community Connector this will be very easy.

  1. Create a Community Connector.
  2. Maintain an Access control list of shop-owner email addresses v shopId in a PostgresSQL table.
  3. In the connector getData code, get the effective user's email.
  4. From the email, get the shopId (#2).
  5. Use a service account to fetch data from Google Analytics and PostgresSQL while filtering for shopId.
  6. Create a datasource and enforce viewer's credentials.
  7. Use datasource in #6 to create a report.
  8. Share this report with all shop-owners.

When shop-owners open the dashboard, they will only see the data for their relevant shopIds.