# Mautic contact tracking custom field number value 0 is not updated

**URL:** <https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436>\
**Category:** General Discussion\
**Created:** [May 12, 2021, 10:32am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436 "2021-05-12T10:32:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![notmyfirstid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/notmyfirstid/32/723_2.png) [@notmyfirstid](https://forum.mautic.org/u/notmyfirstid)\
**Post date:** [May 12, 2021, 10:32am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/1 "2021-05-12T10:32:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 13, 2021, 6:29am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/2 "2021-05-13T06:29:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![notmyfirstid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/notmyfirstid/32/723_2.png) [@notmyfirstid](https://forum.mautic.org/u/notmyfirstid)\
**Post date:** [May 13, 2021, 7:15am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/3 "2021-05-13T07:15:10Z")

</div>

Yes, I did.

 ![505_OReZpw6ORo](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/3/3e85fd45d43aae80de86c3d5259d837f1ab426a7.png)  
 ![506_3MOf9K4jNo](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b62f3749b2b9116c2dfd999a218fb83c551eb214.png)

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 13, 2021, 8:02am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/4 "2021-05-13T08:02:22Z")

</div>

I would raise an issue in Github.

---

<div class="post-metadata">

**Author:** ![notmyfirstid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/notmyfirstid/32/723_2.png) [@notmyfirstid](https://forum.mautic.org/u/notmyfirstid)\
**Post date:** [May 13, 2021, 8:10am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/5 "2021-05-13T08:10:39Z")

</div>

Already did.

> <https://github.com/mautic/mautic/issues/10013>
>
> \## Bug Description
> The more details the better...
> 
> | Q | A
> | --- | ---
> | …Mautic version | 3.3.3
> | PHP version | 7.4.18
> | Browser | Chrome
> 
> \### Steps to reproduce
> \`mt('send', 'pageview', {email: 'user@email.com', firstname: 'username', company: 'company', file\_count: '0', opt: '0', tags: 'tag\_name'});\`
> 1. Create new custom field, for e.g. opt with type number or text.
> 2. Send any empty or '0' as value for custom field in through mautic contact tracker.
> 3. Value is only updated in mauctic contact/lead if it is non-zero or non-null.
> 
> Expected:
> The value should be updated in contact field if it is 0. But, it stays the same, i.e. either empty (null) or any previous non-zero value.
>  
> \### Log errors
> No error reported
> 
> \[//\]: # ( Invisible comment:
> Please check for related errors in the latest log file in \[mautic root\]/app/log/ and/or the web server's logs and post them here. Be sure to remove sensitive information if applicable. )

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [May 13, 2021, 8:11am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/6 "2021-05-13T08:11:59Z")

</div>

BTW what happens if you set the default value?

---

<div class="post-metadata">

**Author:** ![notmyfirstid](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/notmyfirstid/32/723_2.png) [@notmyfirstid](https://forum.mautic.org/u/notmyfirstid)\
**Post date:** [May 13, 2021, 8:16am UTC](https://forum.mautic.org/t/mautic-contact-tracking-custom-field-number-value-0-is-not-updated/19436/7 "2021-05-13T08:16:31Z")

</div>

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.
