Data Studio
5.6K members online now
5.6K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

Just getting into Data Studio. Loving it! It makes so much more sense to my brain than GA Reports or Dashboards... 

 

My question: let's say I have a page with a path of /gizmo/. On that page I track an event whenever someone clicks a button, the event label is "Orange Button". I want to take the total count of my "Orange Button" events, and divide it by unique pageviews of /gizmo/, to get a % comparing clicks to pageviews.

 

 

Is this even possible? I can easily get the pageview data, and the filtered event data - I have even set up Segments in GA to look at really specific event funnels. But this concept of taking event counts (filtered by label) and comparing it to pageview counts (filtered by path) is eluding me.

 

Thanks for any tips.

Will

1 Expert replyverified_user

Events as a % of Pageviews (apples & oranges!)

Explorer ✭ ✭ ✭
# 2
Explorer ✭ ✭ ✭

Have you tried creating your own calculated metric to do (Total Events / Unique Pageviews) ?

 

I don't see why this wouldn't work, then you could apply your filter/advanced segment to your viz.

Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Mike, thanks for replying. I have created a calculated metric, and it works if I'm trying to compare *all* events across the site to *all* pageviews across the site. But if I want to filter events by label, and page by path, it stops working, because I'm applying an event filter and a page filter and so it breaks. I think I'm just missing part of the bigger picture. 

Events as a % of Pageviews (apples & oranges!)

Explorer ✭ ✭ ✭
# 4
Explorer ✭ ✭ ✭

Can you send a screen shot of your viz, data panel, and filter screen.

 

You should be able to filter on either dimension without issue just like you can in the interface.

Events as a % of Pageviews (apples & oranges!)

Google Employee
# 5
Google Employee

The basic approach  is to do something like COUNT( CASE WHEN REGEXP_MATCH(Event Label, ".*Orange Button.*") THEN 1 ELSE 0 END) 

 

That's how you'd get the number of Orange Button clicks. 

 

But I think you might run into trouble, because the Event data is already aggregated. So you may end up just with 1 for that value. 

 

Assuming that works you can then build another calculated field to divide by the number pageviews. ( Calculated fields are built in the data source). To filter by /gizmo/ it might be easiest to do that with a chart filter in the report.

 

This article on CASE, and this one on Conditional calculated fields might help.

 

Hope that all made sense!

 

Rick

Re: Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 6
Visitor ✭ ✭ ✭

Thanks Rick, and Mike.

 

Based on your suggestions I think I am close. Here's a proof of concept report that I have built.

 

On the top half of the report I have scorecards for Total Events, Unique Pageviews, and then a scorecard showing my custom metric "Total Events / Pageviews" (screenshot below). These all use the same filter which enforces that these events and pageviews are happening at the "/" path (screenshot of this filter is below)

 

Screen Shot 2017-06-05 at 9.16.18 AM.png

Screen Shot 2017-06-05 at 9.18.40 AM.png

 

So that works. But then I want to get more specific - I want to see Total Events but only in the category of "CTA". So I create a new scorecard and use a more advanced filter - page path has to be equal to "/" and Event Category must be "CTA". This works fine for the Total Events scorecard, but when I apply it to my custom metric, it breaks:

 

Screen Shot 2017-06-05 at 9.24.05 AM.png

 

This is a screenshot of the filter that is working for Total Events but breaking my Total Events / Unique Pageviews metric:

 

Screen Shot 2017-06-05 at 9.25.18 AM.png

 

And here's a screenshot of my custom metric:

 

Screen Shot 2017-06-05 at 9.26.26 AM.png

 

Any idea how I could achieve what I'm trying to do?

Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭

Hi there,

 

I am exactly facing the same issue as you described before. Have you found the answer? Could you share?

 

Thanks

Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 8
Visitor ✭ ✭ ✭

@Data and Digital T - Unfortunately I never found a suitable way of combining these metrics while filtering by the appropriate dimensions -- I ended up building my own dashboard in Rails using this gem: https://github.com/tpitale/legato

 

Smiley Sad Wish I could be of more help! 

Events as a % of Pageviews (apples & oranges!)

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭

I've also never found a solution to this problem, I don't think it's currently possible using data studio alone.

 

I believe it can be done by pulling GA data into sheets in the format you want (e.g. "date", "number of gizmo page views", "number of button clicks", "dimensions for filtering later..."), then connecting to sheets in datastudio and creating a calculated field for "number of button clicks"/"number of gizmo page views". I've never actually attempted this, so wouldn't be able to talk you through how it's done.

 

I've found an easier solutionin most cases is to set up a goal for "Orange Button Click", then create a segment for sessions who have visited the gizmo page. Create a scorecard with "Orange Button Click (Goal X Conversion Rate)" as the metric, and add the segment. This doesn't give you exactly the same thing, but may provide the same insight?

 

Cheers,

Jonathan