Filtering data in a custom metric?

主宰稳场 提交于 2021-01-29 18:54:51

问题


On a particular type of page, I have an event that fires every time someone enrolls in a product. The event is:

Category: Enroll
Action: < Name of Product >
Label: enroll

I am able to create a report that lists the number of times the event was fired on Pages by using the metric of total events and filtering by the label enroll This gives the page that it was fired on and the count of the event.

I'm now trying to do conversion rate. So, I'd want to get

(Total Events on the page (filtered by Event Label="enroll")) / Unique Pageviews

I can't figure out how to do the total events filtered in Data Studio using a calculated metric. Is there a good way to do this?


回答1:


Try using REGEXP_MATCH in the sum of a case statement to achieve what you need.

Creating a metrics as follows and then do the division by unique pageviews as a second metric.

 SUM(case when REGEXP_MATCH(Event Label, "enroll") then 1 else 0 end)


来源:https://stackoverflow.com/questions/52822231/filtering-data-in-a-custom-metric

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!