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
1.5K members online now
1.5K members online now
Ask questions about Data Studio
Guide Me
star_border
Reply

Own Campaign Types by name

[ Edited ]
Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi,

 

I'd like to create custom dimension where I;ve got 3 types of campaign:

1. Search

2. GDN

3. APP 

All campaigns have a prefix:

1. Search starts [Search]...

2. GDN starts [GDN]...

3. APP starts [APP]...

 

I create regex:

CASE
WHEN REGEXP_MATCH(Campaign, "^.*(Search).*") THEN "Search"
WHEN REGEXP_MATCH(Campaign, "^.*(GDN).*") THEN "GDN"
WHEN REGEXP_MATCH(Campaign, "^.*(APP).*") THEN "APP"
ELSE "Other" END

But there is error 

Unable to aggregate ratio metrics in the request. Please select another metric.

Error ID: 068984b8

In standard regex I'd use "\" to negation brace but in DC it's not working :/ 

So I use .* to work around the problem with brackets.

Any idea what I working wrong?

 

 

Own Campaign Types by name

Participant ✭ ☆ ☆
# 2
Participant ✭ ☆ ☆

 Everything here looks fine, and I actually copy/pasted your case statement directly into a DS report and had no error with the formula.  Is your datasource Google Analytics?

 

Don't know if it'll help but here is a copy/paste back from DS.   

 

CASE WHEN REGEXP_MATCH(Campaign, "^.*(Search).*") THEN "Search" WHEN REGEXP_MATCH(Campaign, "^.*(GDN).*") THEN "GDN" WHEN REGEXP_MATCH(Campaign, "^.*(APP).*") THEN "APP" ELSE "Other" END

Own Campaign Types by name

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Mike,

 

I already know what caused the error - metrics.
Strangely, I had to set up my own definition of CPC and CTR because they were causing problems.
Nevertheless, great thanks for the help