Filter by email address

Provide row-level security to the data for signed-in users.

Reports can request permission to access the current viewer's email address in order to personalize the data shown to that viewer. When you consent to sharing your address with that report, the underlying data source can use that to return only the data associated with that address. This is known as "row-level data security."

Email filter examples

These examples use a data source based on Google Sheets to show how email filtering works.

Email filter example 1. No filter.

Example 1

In example 1, the data source is not filtered. All the data appears in the Data Studio report.

Email filter example 2. Filter applied. User = rick@.

Example 2

In example 2, the data source has an email filter. User Rick is signed in, so only his data appears when he views a report based on the filtered data source.

Email filter example 3. Filter applied. User = daisy@.

Example 3

When Michelle signs in and views the same report, she sees only her data, as shown in example 3.

Email filter example 4. Filter applied. No data for bob@.

Example 4

In example 4, bob@competitor.com signs in and views the report. There is no data for this user, so the Data Studio chart is empty.

When you view a report that includes a data source that uses row-level data security, all components based on that data source will ask you to allow them to use your email address.

You must be signed in to a Google account to view a report that uses email filtering.

Consent dialog.

If you consent

All components in the report based on the data source requesting your email address will be able to show data relevant to you. You can revoke your consent at any time.

If you don't consent

All components in the report based on the data source requesting your email address will show only the consent request. They won't show any data.

For editors

Filter by email is available for any kind of data source. If your data is in BigQuery, you can also use the email parameter in a custom query to filter by email address.

To provide row-level data security, your underlying data must contain a field that stores the email address for your report viewers. You can then create an email filter in the data source using that field. Data Studio can then return the rows of data that contain the email address of the signed-in user.

For example, say you have a Google Sheet that records the performance of your company's sales representatives. Each row in the Sheet contains an email address for one of the sales reps. You can turn on email filtering in the data source connected to that Sheet. When a signed-in viewer views a report based on that data source for the first time, they'll be prompted to give their consent to let that report access their email address. The data source can then query for records containing that address. Only matching records are shown, ensuring that the viewer only sees the data they're meant to see.

Create an email filter

  1. Edit your data source.
  2. In the upper left, click FILTER BY EMAIL.
  3. Turn on Filter data by viewer email.
  4. Select the field in your data source that contains viewer email addresses.
  5. To return to the data source editor, click ALL FIELDS.

Stop filtering by email

  1. Edit your data source.
  2. In the upper left, click FILTER BY EMAIL.
  3. Turn off Filter data by viewer email.

Filter by email in BigQuery

In a BigQuery data source, you can filter by email address using the @DS_USER_EMAIL parameter in a custom query. For example:

Select * from Sales WHERE sales-rep-email = @DS_USER_EMAIL;

This provides additional flexibility in your filters. Learn more about BigQuery parameters.

To stop providing your email address to reports that request it, you can revoke your consent:

  1. Sign in to Data Studio.
  2. In the upper right, click Settings Settings..
  3. On the left, select Revoke Consent, then under Revoke user email, click Revoke all.

After you revoke your consent, you'll need to grant it again before you can see personalized data in reports.

Limits of filter by email

  • Your underlying data set must contain the full email address of the viewers who will be accessing your report.
  • The case of the email addresses in your data must match the case in the users' account. For example, if the user's account belongs to "Bob@MyCompany.com" but your data contains "bob@mycompany.com" the filter won't match (and Bob won't see his data).
  • Viewers must sign in to view a report with email filtering applied, even if the report is shared publicly.
  • Viewers must consent to providing their email address.
Using scheduled email to send a report that filters by email address shows the data of the person who created the scheduled email, NOT the recipient's data. To send a report with email filtering turned on, we recommend directly sending a report link instead of using scheduled email.

Use data blending to filter by multiple email addresses per row.

Was this helpful?
How can we improve it?

Need more help?

Sign in for additional support options to quickly solve your issue