How to pass URL parameters in Looker Studio?

This is a very useful feature for database connections, which allows you to control what users see when they first land on your report. Some people use it to make sure people focus on what matters, others to restrict access, possibilities are endless. In this article, we'll review how to pass URL parameters in Looker Studio (previously known as Data Studio).


Need help ? We offer Looker Studio Support for companies.

Looking for a connector ? Check Supermetrics.


Create a database connection and add two parameters

First of, please create a database connection. In our example, we'll use a Big Query custom query to read a table we've populated with housing data from the Spanish market (please note that not all database connections accept parameters).


We've created 2 parameters using the button Add a parameter at the bottom:

  • One called ciudad_param, to control for the city (default value: BARCELONA). This is a STRING
  • One called multiplicator (default: value: 1), to make some calculations later on. This is Number (whole)


We end up having something like this:

looker studio url parameter big query connection

Create a table and two controls

Once the data source has been created, please add a table with data from your source, and add two Input box controls, one for each parameter we've just created. In the table, we've added a new calculated field:

  • Precio x Multiplicator


You should see the default value you've set in the input boxes:

looker studio url parameter big one table two input boxes

Change settings, find parameters name, and you're good to go!

In order to be able to pass URL parameters, you need to change a few settings:

  • Under Resource, Manage Report URL parameters, please tick Allow to be modified in report URL
  • Make sure to note the name of your parameters, as this is what we'll use to pass parameters
looker studio url parameter parameters name

We're almost there! Now, let's say we want to see data for MADRID, with a multiplicator of 2.


We first need to create the JSON to pass the parameters, this is a string that should look something like that:

params={"ds3.ciudad_param":"MADRID","ds3.multiplicator":2}


Then, proceed to https://www.urlencoder.org/, enter your JSON, click ENCODE, and copy the results the page is giving you.


Back to your report, in Viewer mode, add an interrogation mark ? at the end of the url, paste what you've just copied, replace %3D right after params with an equal sign =, and that's it, you've just passed URL parameters in Looker Studio!

looker studio url parameter url with two parameters

In this quick article, we've reviewed how to pass URL parameters in Looker Studio.

PROBLEM SOLVED !


Previous article: How to use blended data to filter GA4 referral traffic in Looker Studio?

Next article: How to build a stocks portfolio tracker in Looker Studio using Google Sheets, Google Finance and Google Big Query?

Looking for something else? All our articles can be found on our blog page