Skip to content
Advertisement

How can I Embed the Reports Filter in Google Data Studio?

This is a scenario that I am trying to achieve: I created a report in Google Data Studio and embedded to my website. I activated “any one with link can view” option so that this report will be visible to my website users.

But I need to show my website users different data depending on their user ids. Basically showing a filtered data according to user id. But the challenge that I have here is, these users do not have a google account. Due to this, using a community connector and passing an email id in the config function will not work for me.

I tried the bookmarking option where you embed a link and change a parameter for different users. It will show correctly in embed code. But once user clicks or opens in Google Data Studio, then this filter goes off.

Has anyone implemented a work around for this scenario? Showing different data right from the webapplication in which the graph is embedded.

Showing different data according to user id is so critical for our use case that without it, data studio with its all functions cannot be used.

Advertisement

Answer

In that case, we need to create a custom data source provider.

Step 1: We need to write a custom data source to https://script.google.com/. First, edit the Application.json. Here we have to update the manifest JSON and Code.gs script.

For more information https://github.com/googledatastudio/community-connectors/tree/master/JSON-connect/src

appsscript.json

JavaScript

main.js

JavaScript

Step 2: Deploy your code. After deployment, you get “Deployment id” and direct URL of your Data Source.

Step 3: Need to provide your source JSON URL and allow parameters to override by URL. Allow parameters for our need for data according to department wise and connect to the data source.

https://drive.google.com/file/d/1ys4RCPyWYC8wP31jWtCJcZpqt6SIKnMC/view?usp=sharing

So by using a custom connector, we can show data according to the role.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement