Looker Studio

Integrating Looker Studio into Catalog

Requirements

To get things started with Looker Studio you will need:

You will also need to create a Google Service Account, as such you need to have at minimum one of the following roles:

  • 🧑‍💼 Service Account Admin

  • 🧑‍💻 Editor Basic

Finally, to give the needed rights to the service account you will need the following role:

  • 🧑‍💼 Google Workspace Admin

If needed, whitelist Catalog IP

Here is our fixed IP: 35.246.176.138

Catalog managed

1. Create Google Service Account for Catalog

Client creates a service account for Catalog from the Google Console. See how to here

Make sure to create and download a json key for that service account. See how-to here

Take note of the Service Account Cliend ID also known as Unique ID

2. Authorize the Google Service Account for Catalog

Authorize the service account for an organization. See how to here

The scopes to add are:

3. Add credentials in Catalog App

You must be Catalog admin to do it.

You can now enter the newly created credentials in the Catalog App here.

  • Go to "Settings > Integrations"

  • Click on "Looker Studio Add"

Share the following credentials:

  • The JSON credentials of service account created in step 1

  • The email of a Google Workspace user with admin access

The service account will impersonate this admin user in order to obtain the view activity of each Looker Studio asset. Rest assured that the service account’s actions are limited by the scopes and IAM roles/permissions

  • Combine both into this expected format:

{
    "admin_email": "<str>",
    "auth_provider_x509_cert_url": "<str>",
    "auth_uri": "<str>",
    "client_email": "<str>",
    "client_id": "<str>",
    "client_x509_cert_url": "<str>",
    "private_key": "<str>",
    "private_key_id": "<str>",
    "project_id": "<str>",
    "token_uri": "<str>",
    "type": "<str>"
}

Client managed

Running the Extraction package

Install the PyPi package

pip install castor-extractor[lookerstudio]

Optional: BigQuery access

If your Looker Studio data sources are connected to BigQuery:

  • Make sure to install the BigQuery dependencies as well:

pip install castor-extractor[lookerstudio,bigquery]
  • You will require a Service Account with BigQuery access. Consider using the Service Account linked to your BigQuery integration. Note that this can be the same Service Account as for Looker Studio, or a separate one.

For further details on our Extractor Pypi package: link

Running the PyPi package

Once the package has been installed, you should be able to run the following command in your terminal:

castor-extract-looker-studio [arguments]

The script will run and display logs as following:

INFO - Looker Studio credentials fetched from /looker/studio/credentials.json
INFO - BigQuery credentials fetched from /bigquery/credentials.json
INFO - Extracting ASSETS from API
INFO - Refreshing authentication token...
INFO - Refreshing authentication token...

...

INFO - Wrote output file: /tmp/ls/1742219344-summary.json

Credentials

  • -c, --credentials: File path to Service Account credentials with Looker Studio access

  • -a, --admin-email: Email of a Google Workspace user with admin access

Optional arguments

  • -b, --bigquery-credentials: Optional file path to Service Account credentials with BigQuery access. This can be the same file path as for Looker Studio.

  • -o, --output: Directory to write the extracted files to

You can also get help with argument --help

Scheduling and Push to Catalog

When moving out of trial, you'll want to refresh your Looker Studio content in Catalog. Here is how to do it:

The Catalog team will provide you with

  1. Catalog Identifier (an id for us to match your looker files with your Catalog instance)

  2. Catalog Token An API Token

You can then use the castor-upload command:

castor-upload [arguments]

Arguments

  • -k, --token: Token provided by Catalog

  • -s, --source_id: account id provided by Catalog

  • -t, --file_type: source type to upload. Currently supported are { DBT | VIZ | WAREHOUSE }

Target files

To specify the target files, provide one of the following:

  • -f, --file_path: to push a single file

or

  • -d, --directory_path: to push several files at once (*)

Then you'll have to schedule the script run and the push to Catalog, use your preferred scheduler to create this job

You're done!

Last updated

Was this helpful?