How to Add Hyperlinks to Your Data Studio Reports
August 15, 2017 -
You have completed your Data Studio report and are ready to share it – except for one thing. Maybe the URLs in the table are too long or their page paths are unidentifiable. Maybe the table contains a list of YouTube videos that are identified by a string of letters and numbers. Maybe you are presenting the report and need to access the pages should any questions arise. There are many use cases for the Hyperlink function that has recently been introduced to Data Studio tables.
Let’s say you would like to show your top performing landing pages to your blog. You create a table using ‘Landing Page’ as the dimension, and a number of metrics to measure performance. Here is an example of the resulting table:
As you can see, many of the landing pages in the table have been cut off, making it difficult to interpret the report. Here is how to make use of the Hyperlink function to create links in Data Studio tables.
How to create a new dimension:
- Click on the widget to gain access to the Table Properties. Under the Data properties, find the Dimension section, and click on the current dimension selected (in green). A Dimension Picker will open up.
- Click on ‘Create New Dimension’ (in blue) at the bottom of the list of dimensions. This will open up a list of fields available from the data source.
- At the top of the Field column, click on the blue ‘+’ sign to add a new field.
- Provide a name for the new field. It’s best to be as descriptive and concise as possible, and something that is different to one of the names already used in Google Analytics. Using our example above, I will name the new dimension, “Landing Page (with links)”.
- Do not touch the ID field, and instead move your cursor to the Formula field. The Hyperlink function syntax is HYPERLINK(URL, Link Label), which means it requires two pieces of information: the full URL that directs the visitor to the appropriate page, and the text that will be visible in the table (can be a field, expression, or literal value).
In the table above, the landing pages exclude the first part of the URL (the protocol and the domain name), so a Concat function is required. The syntax then is as follows: HYPERLINK(CONCAT(X, Y), Link Label). For our example above, the Landing Page is used as the Link Label, so the table will look the same as above, but with links included. This was the formula used:
Note: If text is used to define X or Y in the Concat function, it must always be contained in quotes. Furthermore, the function supports four protocols (http:, https:, mailto:, and ftp:) and, if neither is specified, then http: is assumed.
Click on ‘Update Field’ and ‘Done’, then select the dimension in the Dimension Picker (you can find it under ‘Default Group’ or search for it by clicking on the magnifying glass). The table (or other widget) will be updated with the new dimension.
Note: Test that the links work. If the links go to a blank page, either the page has been taken down, the protocol was not supported, or something is wrong with the formula. To edit the dimension, follow steps 1 and 2 above. Click on the dimension you created under the Field column to edit the formula. When finished, click ‘Update Field’. The widget will automatically update, and you should see the changes you have made.
The Hyperlink function used above returns the same data as the first table, but with each Landing Page underlined, indicating they are now hyperlinked. At this point, you may want to verify that the data is reflective of what you see in the original source of data, such as Google Analytics.
I hope this has helped you make the data in your tables more visible. Now that the hyperlinks have been added, you are ready to share the report. If you hesitate, you may have some questions: contact us and we can help you!