Annotations for your Looker Studio charts
Marketers & website owners use to fill annotations inside Google Analytics Universal, adding temporal context to data with external events. Unfortunately, this feature is not available for the moment inside Google Analytics 4 and also inside a lot of tools of data collection.
In this article, I describe an annotations system for Looker Studio reports (formerly known as Data Studio) that I designed during the first COVID lockdown.
This feature is missing in GA4 but we can also consider that this device for data context should be external to our main data analytics collection device. After all, if we own a data warehouse storing and providing data from several sources, our annotations system for important life events information will not be dependent to a specific source but it should be cross-source & cross-functional?
October 20, 2022 – Edit
I designed this solution & wrote this article in April 2020 but refreshed it for the following reasons
- Data blending engine has been revamping
- Data Studio was rebranded to Looker Studio
- The user interface of Looker Studio has changed a lot these last 2 years
Let’s build – inside our report – a dynamic Looker Studio annotations system, giving dated context to our data, combining simple built-in features provided by our favorite data viz tool.
My example is based on Google Analytics data but, of course, we can apply exactly the same thing for other statistics and data.
The result
The result below is based on the following elements:
- Google Sheets file storing and maintaining Google Looker Studio annotations data
- Blended data source with annotations and metrics from the main data source
- Combo chart displaying metrics as time series chart and annotations as column chart
- Table chart listing annotations, filterable with the combo chart
1. Google Sheets file as Google Looker Studio annotations data
First, let’s create our annotations source: A simple Google Sheets file, easy to maintain by all your team providing context with events related to all work fields, as example for digital activities:
- Marketing: Offers, campaigns, product marketing…
- IT and application: Release, hot fix…
- SEO: onsite and offsite actions, search engines filters..
- Analytics: Change in measurement plan, optimizations, AB testing launching…
- External events: Regulatory updates, crisis and gradual government decisions…
- …
The sheet will be composed of the following columns:
- Event date
- Status: To decide if the event is visible in our report (Draft or Published)
- Category: like Ads, application release, SEO, Analytics…
- Event: Description of the event
- Comments: Additional information, not necessarily displayed in Looker Studio
We can also imagine to add other columns like “weight” or “probability of impact” to sort/filter events following risk management requirements but let’s keep it simple for this example…
At last, combining Google Sheets with Google Form for filling control purposes could be a good idea following your team and the wished workflow of annotation contributions.
2. Looker Studio configuration
Now, we can add the Google Sheets tab inside our Looker Studio report, as a data source, in addition to your main statistics data source (Google Analytics in this example).
Blended data
Then, we blend data, using Google Analytics as left table and annotations sheet as right table, applying the following configuration:
- Table 1
- Source: Google Analytics (or your specific metric source)
- Metric: Sessions
- Table 2
- Source: Google Sheets annotations
- Dimensions
- Event date
- Event
- Category
- Filter: “GS – Annotations – Exclude draft status” (see below)
- Join configuration
- Join operator: Left join
- Join keys: Date for Table 1 and Event date for Table 2
- Blended date name: “BD – Annotations with GA sessions”
Additionally, we add a filter to the table 2 to exclude draft lines.
Combo chart configuration for sessions time series
Now, we create a time series chart using a combo chart type, respecting the following configuration:
- Setup tab
- Data source: Blended data described above
- Dimension : Date (Google Analytics date)
- Metrics
- Sessions, and edit the option of the chart metric to switch on average, min or max aggregation and so avoid to multiply the value by the number of annotations
- Event dimension with count aggregation (CT)
- Sort: Date ascending
- Cross interactions: Turn on “Cross filtering” option (so when we will click on a specific date, the list of annotations below will be filtered)
- Style tab
- Series #1 (sessions) with line using strong color (blue in the example), on the left Y-axis
- Series #2 (annotations) with light-colored bars (orange in the example), on right Y-axis
- Right Y-Axis: Set the Axis max to 1 to get the same bar height when one or more annotations exist for a specific date
- Do not show chart header
To hide right Y-axis, we can also add a background-colored rectangle element over the combo chart.
Table chart configuration for filterable annotations list
Then, let’s add a table chart to list annotations, with the following parameters:
- Setup tab
- Data source: Our blended data again
- Dimensions: Date, Category and event
- No metric
- Sort by Date ascending
- Add a table filter excluding lines without annotation: Exclude when “Event” Is Null
- Style tab
- For color consistency, use the same light color for header background than annotations in the combo chart (orange in the example)
- Table body: Wrap text to allow it from Google Sheets (including list in the same cell)
- Turn off the footer pagination
- Do not show chart header
- Group combo chart with annotations table to ensure filtering only on annotations table and not on all page elements
Voilà! Ready! Configuration review
let’s check the full configuration with this video.
Other articles about annotations
Here nice articles about the same subject with various technics and concerns.
- From Michele Kiss before data blending was released
- From Chris Green about Google Algorithm updates
- Lee Hurst wrote also about another solution based on calculated fields created inside your main data source to add annotation comments with CASE WHEN statement following dates values. You will find all details in his amazing book “Hands On With Google Data Studio” – page 367. A must read if you decide to jump into Google Looker Studio.
Final thoughts: Annotations finder & other articles
As an absolute source of information without correlation with any statistics except dates, reader can need to find specific event inside the report. So, we can imagine to add a specific page with all Google Looker Studio annotations and related search engine, composed of a collection of filter controls. Possibilities are endless…
At last, if you need more ideas about how to provide data context inside your report, your can read an article proposing a solution of custom helpers with switch, for a better understanding of your report by other users.