Mautic contact tracking custom field number value 0 is not updated

Hello,

I am tracking leads with contact tracking. I have added their email, username and number of files hosted with us.

We send email based on number of files threshold. For files_counts we have set custom fields with type “number” and default value 0. It is updated when users login to their profile.

mt('send', 'pageview', {email: 'user@email.com', firstname: 'username', company: 'company', file_count: '10', opt: '0', tags: 'tag_name'});

The problem is, when any user has 0 files, or opt value is 0, it is not reflected on their contact on mautic.

For e.g. if user had 10 files, it is reflected on mautic on custom field.
But, when they delete their file, the value ‘0’ is never updated. However, anything greater than 0 is processed, and updated in the custom field.

Does mautic custom field type “number” doesn’t accept ‘0’ as value?
If yes, what is the solution for this?

I really need the value 0 to be populated in the custom field somehow.

Just a quick question:
Did you allow that field to be publicly updatable?

Yes, I did.


I would raise an issue in Github.

Already did.

BTW what happens if you set the default value?

If I set default value as ‘0’, the contact has value for opt as 0, until it is set to 1 by contact tracking script. But once it is set to non-zero value, it is never changed back to 0, when it is passed. It stays at 1.

Same is true for text or number type fields.