Empty string in mapping, how does it works?

Gold Contributor
Gold Contributor

Hi there,
i've 2 variables set in mapping in GA4 tag, like this : 
1)
custom value (if A == true return B else "" (empty string)) --> all_events.variable1

2)
custom value (if C == "D" return D else "" (empty string)) --> page_view.variable2

So, in the first case 1), the behaviour is correct. I don't see the variable in datalayer if the condition is false.

In the second case 2), when the condition is false i see the variable2 with empty string. 

Why? 

I would to see the variable in datalayer only if the condition is true.
Can you help me?

Public