This website uses cookies and similar technologies to collect information you provide and information about your interactions with our sites to improve your experience, analyze performance and traffic on our website and assist our marketing efforts and customer service. We may share this information with our third-party partners. You can change your cookie preferences here. By continuing to browse, you agree to our use of these tools in accordance with our Privacy Notice and you agree to the terms of our Terms of Service.
We’re having a challenge with some events that in some cases have a null value on a property. We want to send the events to GA4 Cloud. That destination does not accept null values so it will fail the event if we try to send it.
We figured to solve this with a coalesce on the mapping of these properties. Then, if it has null, it would use the fallback value to replace null with a string. It turns out you can not set a static value in the coalesce function on the mapping. It will only allow to select 2 properties in the coalesce function.
We try to avoid using an insert function as that makes the setup way more complex in our opinion.
Are there any ways around this?
Thanks!
Best answer by Gray Sanborn
Is there a specific reason that you’re passing properties with `NULL` values?
My recommendations, in order:
Do not send properties if they do not have a value.
Simplest solve, which prevents the issue entirely.
Requires development time to modify event emission.
If a property does not have a value and must be sent, use a known, obvious sentinel value.
Helpful if you need to know when a value has been un-set and is not simply unpopulated.
Requires development time to modify event emission.
Requires coordination to determine a sentinel value.
Create a “Destination Insert Function” to clean the data before sending to the Destination.
Best when used on a temporary basis.
Requires development time to modify event emission.
Hi Gray, thanks for your response! My initial thought when my team was discussing this issue was the same; Why do we send a property if it is empty? Shouldn’t it just be dropped instead of passed on the event?
Unfortunately, it needs or will be on the event regardless, at least for now.
I think your suggestion of passing a sentinel value is a good solution I think!