12.10. Parameter Example: Dynamic Dimension
In this lesson, we will explore dynamic dimensions in Looker Studio. Typically, when you create a table or chart, you determine the dimensions and metrics, and the viewer has limited options to modify it. However, parameters allow you to give viewers the ability to change dimensions.
Consider a table that breaks down sessions by source. If you want to enable viewers to change the table from sessions by source to sessions by medium, campaign, or country, you can do that with parameters.
- Understand the concept of dynamic dimensions in Looker Studio and its applications.
- Learn how to create a dropdown menu using text-based parameters.
- Utilize the
CASEfunction to change the table dimensions based on user selection.
- Create custom fields to implement dynamic dimensions in tables.
- Develop techniques to change table titles based on the selected dimension.
Main Concepts and Topics
- Dynamic dimensions: Allowing users to change table dimensions using parameters.
- Text-based parameters: Used to create a dropdown menu with allowed values.
- CASE function: Changes the dimension in the table based on the selected value of the parameter.
- Custom fields: Required to create a table breakdown field that uses the
- Changing table titles: Creating an additional table with no header or metric to display the selected dimension as the title.
Creating the Dropdown Menu
Start by creating a dropdown menu using a parameter called breakdown. It's a text-based parameter with five different values (by source, by medium, by campaign, by country, and by other dimensions you want to include). Text-based parameters with allowed values can be connected to a dropdown menu.
Using the CASE Function
Next, use the
CASE function to change the dimension in the table based on the selected value of the parameter. For instance, when the parameter equals "by country," the dimension of the table should be "country." The
CASE function looks at the value selected by the user and outputs the categories within different dimensions based on that value.
Creating a Custom Field
Create a custom field called table breakdown. This field does not exist in Google Analytics, so it should be a custom field. The custom field will use the
CASE function to output the appropriate dimension based on the value of the breakdown parameter.
Changing the Table Title
To change the table title based on the selected dimension, create another table with no header, metric, or row numbers. The table will display the selected dimension as the title.
Imagine you are a marketing analyst for an e-commerce website. By using dynamic dimensions, you can create a single table that allows your team to switch between dimensions such as sessions by source, medium, campaign, or country. This enables your team to quickly analyze different aspects of your marketing efforts, improving decision-making and saving time.