0
votes

I want to create metric whith % of https sessions, like:

content group 1 - 100 sessions - 25 % https

content group 1 -120 sessions - 30% https

For this purpose was created:

1) Custom Dimension in GA session level: https OR http

2) in DataStudio

field in data source

SUM(CASE
    WHEN protocol = "https:" THEN 1
    ELSE 0 END)

OR

CASE
WHEN protocol = "https:" THEN 1
ELSE 0 END

But I always get the output 1 or 100%

1

1 Answers

1
votes

Is it not because you haven't divided by the total count?

SUM(CASE
WHEN protocol = "https:" THEN 1
ELSE 0 END)/count(protocol)