You can share any deployment of your Community Connector with a link. When a user follows the link, it will take them directly to Data Studio with your connector selected.
To get a direct link for your community connector, follow these steps:
- Navigate to Apps Scripts and open the project of the Community Connector you want to share. Click on Publish > Deploy from manifest.
- For the specific deployment you want to share, click on the deployment name
or the Data Studio icon next to the Get ID link. It will display the direct
link into Data Studio for this connector. Alternatively, you can get the ID
for the deployment by clicking Get ID. This ID should be appended to the
following URL to form a direct link:
https://datastudio.google.com/datasources/create?connectorId=YOUR_DEPLOYMENT_ID
- The direct link can be shared with users. For example, you could post it on your website, blog, or on social media.
Pre-Populate the Configuration
If you know the configuration values that your users will want ahead of time, you can provide a few more query parameters to pre-populate the connector configuration. The pre-populated configuration can still be modified, but your users won't have to manually type it in.
Creating A Pre-Populated Link
To create a pre-populated direct link, you can add the following optional query parameters to a connector direct link:
connectorConfig
- A URL encoded JSON string containing key-value pairs to use to pre-populate the connector configuration.- Key names must match the parameter names defined in the connector config.
TEXTINPUT
,TEXTAREA
, andSELECT_SINGLE
values should be strings.CHECKBOX
values should be a boolean.SELECT_MULTIPLE
values should be an array of strings.
reportTemplateId
- An identifier for the default reporting template to use for the connector. If a default template is set in the connector manifest, this value will override the manifest. See How To Add The Report Template for the value to use.
Example
The following example illustrates how to create a direct link to the
StackOverflow Questions community connector. The direct link
pre-populates the connector configuration to use the google-data-studio
tag on
Stack Overflow.
Try the direct link to the StackOverflow connector
Step 1: Create the config JSON
The keys for the config JSON are the names of each configuration item. For the
StackOverflow config, these names are tagged
, pagesize
, and
sort
.
JSON before encoding
{
"tagged": "google-data-studio",
"pagesize": 25,
"sort": "activity"
}
Step 2: Encode URL
After the configuration JSON is created, you need to URL encode the object. The
easiest way to do this is with the encodeURIComponent
JavaScript function.
Encoding Url
// get a reference to the jsonConfig
var jsonConfig;
var encoded = encodeURIComponent(jsonConfig);
The result is the following encoded string:
"%7B%22tagged%22%3A%22google-data-studio%22%2C%22pagesize%22%3A%2225%22%2C%22sort%22%3A%22activity%22%7D"
Step 3: Build the URL
The following code builds the direct link. Note that you will need your connector's deployment Id to build the URL.
This returns the following encoded URL, a pre-populated direct link for the connector:
https://datastudio.google.com/datasources/create?connectorConfig=%7B%22tagged%22%3A%22google-data-studio%22%2C%22pagesize%22%3A%2225%22%2C%22sort%22%3A%22activity%22%7D&reportTemplateId=1lR9CGfx3uyQp6oz7oAgA1rsqZViA-IQs&connectorId=AKfycbwGMj-oe532y-NEbMHo-KLUCEz0EEGOZj-3lhEgw7q65-hs-T_F9B3Qjw
Try the link to see how it fills in the config.