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

Conditional pageview help

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hello,

 

I'd like to find out the number of pageviews for a given page, say page-a.

I've read https://support.google.com/datastudio/answer/7359285?hl=en and figured that I need a conditional calculated field in Data Studio.

 

The closest that I could get is 

Pageviews * MAX(CASE WHEN REGEXP_MATCH(Page, '.*/page-a.*') THEN 1 ELSE 0 END)

I understand that the above statement returns me the total Pageviews instead of the Pageviews that contatins /page-a.

 

When I try to debug the statement with

MAX(CASE WHEN REGEXP_MATCH(Page, '.*/page-a.*') THEN Pageviews ELSE 0 END)

I get an error. 

 

Can anyone point me in the right direction to get this working please?

Conditional pageview help

Explorer ✭ ✭ ☆
# 2
Explorer ✭ ✭ ☆

Unfortunately you can't do this sort of thing in Data Studio. Instead use a filter to see the Pageviews for just the pages that match your condition.

Conditional pageview help

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thank you for your reply Sian. My intention was to use the conditional calculated field as a Scorecard to represent a percentage of my funnel.

E.g. using a 3 step funnel, I was planning to have conditional calculated fields to do the following:

funnel step 1, page-a Pageviews / page-a Pageviews (which gives me 100%)

funnel step 2, page-b Pageviews / page-a Pageviews

funnel step 3, page-c Pageviews / page-b Pageviews