# Custom JavaScript events contact

**URL:** <https://community.hubspot.com/t/custom-javascript-events-contact/143631>\
**Category:** APIs & Integrations\
**Tags:** events\
**Created:** [December 3, 2025, 12:59pm UTC](https://community.hubspot.com/t/custom-javascript-events-contact/143631 "2025-12-03T12:59:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndPat](https://avatars.discourse-cdn.com/v4/letter/a/a9adbd/32.png) [@AndPat](https://community.hubspot.com/u/AndPat)\
**Post date:** [December 3, 2025, 12:59pm UTC](https://community.hubspot.com/t/custom-javascript-events-contact/143631/1 "2025-12-03T12:59:02Z")

</div>

Hi,

I am new to custom events and I am trying to figure out how the event is associated to the correct HubSpot contact in for JavaScript events.

In the case of API events, we can select which property to match on.

Can someone help me understand the mechanism?

Many Thanks!

---

<div class="post-metadata">

**Author:** ![evaldas](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/evaldas/32/69160_2.png) [@evaldas](https://community.hubspot.com/u/evaldas)\
**Post date:** [December 3, 2025, 3:14pm UTC](https://community.hubspot.com/t/custom-javascript-events-contact/143631/2 "2025-12-03T15:14:51Z")

</div>

Hi @AndPat,

In short, the JavaScript option works in tandem with the HubSpot tracking code, where it can identify user only when they convert (i.e. form submission) or if it’s a returning user with an existing cookie.

If the user never converts, the custom event should still get recorded but won’t be associated to any contacts and will likely be shown as “Unknown User” in the custom event analytics.

Hope this helps!
