A Scalable Way To Add Annotations of Notable Events To Your Reports in Data Studio
Documenting and sharing important events that affected your business are key to an accurate interpretation of your data.
For example, perhaps your analytics tracking broke for a week last July, or you ran a huge promo in December. Or maybe you doubled paid search spend, or ran a huge A/B test. These events are always top of mind at the time, but memories fade quickly, and turnover happens, so documenting these events is key!
Within Google Analytics itself, there’s an available feature to add “Annotations” to your reports. These annotations show up as little markers on trend charts in all standard reports, and you can expand to read the details of a specific event.
However, there is a major challenge with annotations as they exist today: They essentially live in a silo – they’re not accessible outside the standard GA reports. This means you can’t access these annotations in:
- Google Analytics flat-table custom reports
- Google Analytics API data requests
- Big Query data requests
- Data Studio reports
While I can’t solve All.The.Things, I do have a handy option to incorporate annotations in to Google Data Studio. Here’s a quick example:
Not too long ago, Data Studio added a new feature that essentially “unified” the idea of a date across multiple data sources. (Previously, a date selector would only affect the data source you had created it for.)
One nifty application of this feature is the ability to pull a list of important events from a Google Spreadsheet in to your Data Studio report, so that you have a very similar feature to Annotations.
To do this:
Prerequisite: Your report should really include a Date filter for this to work well. You don’t want all annotations (for all time) to show, as it may be overwhelming, depending on the timeframe.
Step 1: Create a spreadsheet that contains all of your GA annotations. (Feel free to add any others, while you’re at it. Perhaps yours haven’t been kept very up to date…! You’re not alone.)
I did this simply, by just selecting the entire timeframe of my data set, and copy-pasting from the Annotations table in GA in to a spreadsheet
You’ll want to include these dimensions in your spreadsheet:
- Date
- The contents of the annotation itself
- Who added it (why not, might as well)
You’ll also want to add a “dummy metric”, which I just created as Count, which is 1 for each row. (Technically, I threw a formula in to put a one in that row as long as there’s a comment.)
Step 2: Add this as a Data Source in Data Studio
First, “Create New Data Source”
Then select your spreadsheet:
It should happen automatically, but just confirm that the date dimension is correct:
3. Create a data table
Now you create a data table that includes those annotations.
Here are the settings I used:
Data Settings:
- Dimensions:
- Date
- Comment
- (You could add the user who added it, or a contact person, if you so choose)
- Metric:
- Count (just because you need something there)
- Rows per Page:
- 5 (to conserve space)
- Sort:
- By Date (descending)
- Default Date Range:
- Auto (This is important – this is how the table of annotations will update whenever you use the date selector on the report!)
Style settings:
- Table Body:
- Wrap text (so they can read the entire annotation, even if it’s long)
- Table Footer:
- Show Pagination, and use Compact (so if there are more than 5 annotations during the timeframe the user is looking at, they can scroll through the rest of them)
Apart from that, a lot of the other choices are stylistic…
- I chose a lot of things based on the data/pixel ratio:
- I don’t show row numbers (unnecessary information)
- I don’t show any lines or borders on the table, or fill/background for the heading row
- I choose a small font, just since the data itself is the primary information I want the user to focus on
I also did a couple of hack-y things, like just covering over the Count column with a grey filled box. So fancy…!
Finally, I put my new “Notable Events” table at the very bottom of the page, and set it to show on all pages (Arrange > Make Report Level.)
You might choose to place it somewhere else, or display it differently, or only show it on some pages.
And that’s it…!
But, there’s more you could do
This is a really simple example. You can expand it out to make it even more useful. For example, your spreadsheet could include:
- Brand: Display (or allow filtering) of notable events by Brand, or for a specific Brand plus Global
- Site area: To filter based on events affecting the home page vs. product pages vs. checkout (etc)
- Type of Notable Event: For example, A/B test vs. Marketing Campaign vs. Site Issue vs. Analytics Issue vs. Data System Affected (e.g. GA vs. AdWords)
- Country…
- There are a wide range of possible use cases, depending on your business
Your spreadsheet can be collaborative, so that others in the organization can add their own events.
One other cool thing is that it’s very easy to just copy-paste rows in a spreadsheet. So let’s say you had an issue that started June 1 and ended June 7. You could easily add one row for each of those days in June, so that even if a user pulled say, June 6-10, they’d see the annotation noted for June 6 and June 7. That’s more cumbersome in Google Analytics, where you’d have to add an annotation for every day.
Limitations
It is, of course, a bit more leg work to maintain both this set of annotations, AND the default annotations in Google Analytics. (Assuming, of course, that you choose to maintain both, rather than just using this method.) But unless GA exposes the contents of the annotations in a way that we can pull in to Data Studio, the hack-y solution will need to be it!
Solving The.Other.Things
I won’t go in to it here, but I mentioned the challenge of the default GA annotations and both API data requests and Big Query. This solution doesn’t have to be limited to Data Studio: you could also use this table in Big Query by connecting the spreadsheet, and you could similarly pull this data into a report based on the GA API (for example, by using the spreadsheet as a data source in Tableau.)
Thoughts?
It’s a pretty small thing, but at least it’s a way to incorporate comments on the data within Data Studio, in a way that the comments are based on the timeframe the user is actually looking at.
Thoughts? Other cool ideas? Please leave them in the comments!