# Custom Behavior Event with boolean properties bug

**URL:** <https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [September 2, 2025, 3:00pm UTC](https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875 "2025-09-02T15:00:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![manalive](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@manalive](https://community.hubspot.com/u/manalive)\
**Post date:** [September 2, 2025, 3:00pm UTC](https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875/1 "2025-09-02T15:00:05Z")

</div>

Hello!

I’ve got the HubSpot Tracking code installed on my site. I’m trying to send a custom behavioral event with properties. One of the properties on my behavioral event is boolean. For that property, when my javascript writes out an event with a true or null value, it gets recorded just fine in HS.

However, if I try to send a false value, it gets recorded as null (or -- in the UI).

To reproduce the problem:  
1. Create a custom behavioral event with a boolean property.  
2. Send a false value for the property from the js

```lia-code-sample
window._hsq.push([
 'trackCustomBehavioralEvent',
 {
 name: 'pe123456_course_registration',
 properties: {
 is_working: false
 },
 },
]);

```

I expected to see false come through in that event for the is\_working property.

In reality, I did not see the is\_working property come through on the event at all.

A current work around I’m employing is to send the strings ‘true’ and ‘false’

```lia-code-sample
window._hsq.push([
 'trackCustomBehavioralEvent',
 {
 name: 'pe123456_course_registration',
 properties: {
 is_working: 'false',
 },
 },
]);

```

and that registers the is\_working property with a false value for an event.

---

<div class="post-metadata">

**Author:** ![Victor\_Becerra](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@Victor\_Becerra](https://community.hubspot.com/u/Victor_Becerra)\
**Post date:** [September 2, 2025, 4:18pm UTC](https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875/2 "2025-09-02T16:18:17Z")

</div>

Hi @manalive  
Thank you for reaching out to the Community!  
I’d like to invite some community members who are subject matter experts to join this conversation.  
@coldrickjack [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) @MBERARD - Would you be able to share any insights on this? Your expertise would be greatly appreciated.  
Best,  
Victor

---

<div class="post-metadata">

**Author:** ![zach\_threadint](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/zach_threadint/32/46318_2.png) [@zach\_threadint](https://community.hubspot.com/u/zach_threadint)\
**Post date:** [September 2, 2025, 11:49pm UTC](https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875/3 "2025-09-02T23:49:35Z")

</div>

Hi @manalive 👋

Assuming your workaround sending in true/false as strings is resulting in the expected outcome, I’d just continue to take that approach. I know that boolean checkbox properties that belong to CRM records generally are set with strings (i.e. the internal valid value options are ‘true’ and ‘false’, not their boolean counterparts). This is regardless of whether the valid value options are set as strings or booleans at the time of property creation via API. For example:

**POST** /crm/v3/properties/ **TICKET**

```lia-code-sample
{
 "groupName": "ticketinformation",
 "name": "test_boolean_1",
 "label": "Test Boolean 1",
 "type": "enumeration",
 "fieldType": "booleancheckbox",
 "options": [
 {
 "value": true,
 "label": "Yes"
 },
 {
 "value": false,
 "label": "No"
 }
 ]
}

```

Results in this response:

```lia-code-sample
{
 ...

 "name": "test_boolean_1",
 "label": "Test Boolean 1",
 "type": "enumeration",
 "fieldType": "booleancheckbox",
 "description": "",
 "groupName": "ticketinformation",
 "options": [
 {
 "label": "Yes",
 "value": "true", // notice the valid value option is a string
 "displayOrder": 0,
 "hidden": false
 },
 {
 "label": "No",
 "value": "false", // notice the valid value option is a string
 "displayOrder": 1,
 "hidden": false
 }
 ],

 ...
}

```

I hope this proves helpful. Please let me know if you have any follow-up questions.

_Moderator note: While this solution may not address the original poster’s specific situation, it could be helpful for other community members facing similar challenges._

---

<div class="post-metadata">

**Author:** ![manalive](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@manalive](https://community.hubspot.com/u/manalive)\
**Post date:** [September 3, 2025, 3:13pm UTC](https://community.hubspot.com/t/custom-behavior-event-with-boolean-properties-bug/138875/4 "2025-09-03T15:13:40Z")

</div>

[@Victor\_Becerra](https://community.hubspot.com/t5/user/viewprofilepage/user-id/620965) [@zach\_threadint](https://community.hubspot.com/t5/user/viewprofilepage/user-id/324811) Thanks for looking at this with me. How can this issue be reported to the HubSpot team building the tracking code? Our app code is having to do some weird conversion just for the events sent through the trackCustomBehavioralEvent code.

As a developer, if I have a boolean value and I’ve setup my custom event to be of boolean type, I would expect the api to accept boolean values. The [HTTP API for event completions](https://developers.hubspot.com/docs/api-reference/events-send-event-completions-v3/basic/post-events-v3-send) will only accept boolean values for this property. The other thing the value `true` works as well. It is only `false` that is the problem.

I know this is ridiculous but I looked through the analytics code from [https://js.hs-analytics.net/analytics/1756911900000/20221873.js](https://js.hs-analytics.net/analytics/1756911900000/20221873.js) . In the hstc.tracking.Tracker.prototype.trackCustomBehavioralEvent function the false value isn’t being sent because the safeString function believes the false value isEmpty and so will return “” instead of false.

 ![manalive_2-1756912329795.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/4/8415cf2c82d0da56a4cb9fdf310699562309c8fd.png)

When I was seeing this behavior I felt like I was going crazy and I just had to make verify whether it was me or not lol.
