Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Data Studio: How to count number of specific events

I know similar questions were asked before, but none of the answers that I found (example here, another example) helped me.


What I am trying to do:

Create a report in Google Data Studio that shows me number of Unique Page Views VS Specific Event. For example: how many users visited page X, and how many of those clicked in button Y.

enter image description here (Example of what I am trying to achieve) ☝️


What I already have:

Google Analytics is configured and events are tracked. When I go to Google Analytics I can see the numbers there. Google Data Studio is already connected to my Google Analytics and the numbers are matching.


What I tried so far:

Test 1

Create a chart using Unique Page Views and Unique Events metrics and set a filter with Event Name = "Button clicked", but that filters my Unique Page Views metric and I end up with wrong numbers.

Test 2

Create a Calculated Field using:

SUM(case when REGEXP_MATCH(Event Action, "Button clicked") then 1 else 0 end)

or using:

COUNT(case when REGEXP_MATCH(Event Action, "Button clicked" ) then "Button clicked" else NULL end)

But this only returns 1


Appreciate any other ideas 💡

like image 658
Bruno Monteiro Avatar asked Mar 27 '20 03:03

Bruno Monteiro


People also ask

How do I count unique values in a data studio?

COUNT_DISTINCT returns the total number of unique items in that field or expression. To count all items, including duplicates, use COUNT . There are 2 other ways to apply this function: In a data source, change a field's Aggregation type to Count Distinct .

What is Google Analytics event count?

An event allows you to measure a distinct user interaction on a website or app. For example, loading a page, clicking a link, and completing a purchase are all interactions you can measure with events.

How do I sum duration in Google Data Studio?

Convert your data into seconds (as a number), and then your recognize this data as time in Data Studio. For example, convert 00:03:00 into 180 seconds in your data sheet [You can use = ( seconds (a1) + minutes (A1)*60)] then set the field in GDS as a number, and type as Duration.


1 Answers

Try data blending feature:

  1. Create first plot with Visitors/Users or Unique Page View.
  2. Create second plot with Unique Event filtered as you want.
  3. Select both plots, right-click on one of them, select Blend data.

Example (with addition of unfiltered plot for comparison): Plot comparison

like image 135
RaV Avatar answered Nov 02 '22 22:11

RaV