By clicking “Accept”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.
Jun 13, 2024
Looker Studio

New Data Studio (Looker Studio) feature: Linking API

New management possibilities for your dashboards. By Alexander Junke

The URL structure

The Linking API can be managed just by building an URL. The URL always has the same path and all of the customizations are made in the parameters.

The path is always:

https://datastudio .google.com/reporting/create

After the path, you can add the parameters to customize the experience of the user of the dashboard or change the dashboard itself.

Change the report settings

There are some standard parameters you can add to the Linking URL. These are also called control parameters:

So a possible URL would be:

https://datastudio.google.com/reporting/create?c.reportId=ca5902da-ad31-1z34-13f8-98ec5f3ad950&c.pageId=p_xu283kdkwl&c.mode=edit

​​

There is currently one setting for the report you are sharing:

  • r.reportName: Set the name of the report (If unspecified: Template Report Name - Date, Time)

Workflow of the Linking API

When you click on one of these prepared links, at first you see the report with the selected page, in the selected mode and you can work with the dashboard already. Additionally at the top right corner is a “Save and share” button.

After clicking on this button a new menu for setting up the data sources appears.

Bildschirmfoto 2022-08-22 um 22.55.13.png

You see the connected data sources and more information about the different connector settings (e.g. for BigQuery data: project, dataset, table, …). Furthermore, you can edit the data source, change fields, reconnect to another source, and more.

When you click then the “Acknowledge and save” button, a new report gets created with all the settings you have chosen.

Switch the Data Sources

Set up Data Sources

You can change the data source settings by creating the new dashboard from the template. But it is also possible to do adjustments already with the “programmed” URL.

For the shared dashboard you can also replace or update the connected data sources. The settings for the different connector types are highly different. Due to that, we are focusing on the connector we have the most experience with, Google BigQuery.

The data source parameters for a BigQuery source you can add to the URL are the following:

  • ds.alias.datasourceName: The name of the data source
  • ds.alias.connector: The connector you want to use (in our case BigQuery)
  • ds.alias.projectId: The id of the GCP project you want to connect
  • ds.alias.type: which type of data it is (e.g. TABLE)
  • ds.alias.datasetId: The id/name of the dataset you want to connect
  • ds.alias.tableId: The id/name of the table you want to connect

The following connectors are currently supported by the Linking API:

  • BigQuery
  • Cloud Spanner
  • Google Analytics
  • Google Cloud Storage
  • Google Sheets
  • Google Surveys
  • Search Console

The data source alias

The missing part is the alias of the data source. In the previous weeks, you might have already recognized the alias next to the data source.

Bildschirmfoto 2022-08-22 um 22.55.20.png

Alias of the data sources

Every data source has an id attached which always starts with “ds” and then a random number behind. To change the data source settings for the new report, you have to use the alias of the template's data source in the final URL.


An example URL with changing the data source would be:
https://datastudio.google.com/reporting/create?c.reportId=ca5902da-ad31-1z34-13f8-98ec5f3ad950&c.pageId=p_xu283kdkwl&c.mode=edit&ds.ds334.datasourceName=changeddatasource&ds.ds334.connector=bigQuery&ds.ds334.projectId=project-123&ds.ds334.type=TABLE&ds.ds334.datasetId=marketing_data&ds.ds334.tableId=daily_channels

Error in the configuration

If there is an error in your URL you also get an error message.

Bildschirmfoto 2022-08-22 um 22.55.25.png

In this case, the value of the type parameter is wrong. It should be TABLE.

Conclusion

Google improved with this API the way of duplicating and sharing dashboards and changing during the process the most important configurations. The idea is to build template reports and create custom reports out of these, with their own report settings and other data source connections.

Further Links

Follow us on LinkedIn for insights into our daily work and important updates on BigQuery, Data Studio, and marketing analytics.

Subscribe to our YouTube channel for discussions on DWH, BigQuery, Looker Studio, and Google Tag Manager.

If you are interested in learning BigQuery from scratch, get access to our free BigQuery Course

Elevate your skills with Google Data Studio and BigQuery by enrolling in our Udemy course.

Need help setting up a modern, cost-efficient data warehouse or analytical dashboard? Email us at hello@datadice.io to schedule a call.