AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

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

Metric for mobile/desktop sessions

Follower ✭ ✭ ☆
# 1
Follower ✭ ✭ ☆

Want to have a line chart that tracks the % of total traffic from desktop vs. mobile. 

 

Currently settled on trying to at least get a line chart for mobile sessions and desktop sessions. 

However, my custom metric isn't working, these are what I've tried: 

 

COUNT(CASE WHEN REGEXP_MATCH(Device Category, 'mobile') THEN 1 ELSE 0 END)

SUM(CASE WHEN REGEXP_MATCH(Device Category, 'mobile') THEN 1 ELSE 0 END)

Metric for mobile/desktop sessions

Participant ✭ ✭ ☆
# 2
Participant ✭ ✭ ☆

Instead of using a case statement, try creating a bar chart. For your dimension, select the monthyear, then use device category as your breakdown dimension. In the properties menu, choose the 100% stacked bar option so it puts mobile and desktop on the same vertical.