Hello,
I'm trying to create a custom channel grouping for Google Analytics measurement. I've been using this formula for years but it no longer works because of the "AND NOT" operator:
WHEN REGEXP_MATCH(Source / Medium,'X') AND CONTAINS_TEXT(Campaign,'Y') AND NOT REGEXP_MATCH(Campaign, 'Z') THEN "Paid Brand Search"
WHEN REGEXP_MATCH(Source / Medium,'A') AND REGEXP_MATCH(Campaign,'B') AND NOT REGEXP_MATCH(Campaign,'C') THEN "Paid Non-Brand Search"
WHEN REGEXP_MATCH(Source / Medium,'D') AND NOT CONTAINS_TEXT(Source / Medium,'E') THEN "Retargeting"
ELSE "Other"
END
When I remove "NOT" it works as it should. I also tried to add (^) as an alternative:
WHEN REGEXP_MATCH(Source / Medium,'X') AND CONTAINS_TEXT(Campaign,'Y') AND REGEXP_MATCH(Campaign, '^Z') THEN "Paid Brand Search"
WHEN REGEXP_MATCH(Source / Medium,'A') AND REGEXP_MATCH(Campaign,'B') AND REGEXP_MATCH(Campaign,'^C') THEN "Paid Non-Brand Search"
WHEN REGEXP_MATCH(Source / Medium,'D') AND CONTAINS_TEXT(Source / Medium,'^E') THEN "Retargeting"
ELSE "Other"
END
But this didn't work either. Can you help me with this? Is there an error here that I'm not seeing?
Best regards,
Ece.
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |