# Rudderstack and HubSpot

**URL:** <https://community.hubspot.com/t/rudderstack-and-hubspot/101375>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [February 29, 2024, 1:47am UTC](https://community.hubspot.com/t/rudderstack-and-hubspot/101375 "2024-02-29T01:47:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TDearlove6](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@TDearlove6](https://community.hubspot.com/u/TDearlove6)\
**Post date:** [February 29, 2024, 1:47am UTC](https://community.hubspot.com/t/rudderstack-and-hubspot/101375/1 "2024-02-29T01:47:37Z")

</div>

Hi All, long shot. We are trying to replace our current forms with a HubSpot form, but the blocking issue is we need to create a Rudderstack track event that fires upon from submisssion. Has anyone done this before? While HubSpot is a Source in Rudderstack, it only allows you to send data to a data warehouse.

---

<div class="post-metadata">

**Author:** ![Anton](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/anton/32/103167_2.png) [@Anton](https://community.hubspot.com/u/Anton)\
**Post date:** [February 29, 2024, 10:13am UTC](https://community.hubspot.com/t/rudderstack-and-hubspot/101375/2 "2024-02-29T10:13:15Z")

</div>

Hi @TDearlove6,

if you’re embedding the HubSpot forms on a “non-HubSpot-page” you can [modify the form-embed code](https://legacydocs.hubspot.com/docs/methods/forms/advanced_form_options) with a onFormSubmit action and trigger the Rudderstack tracking event.

Here’s a quick example:

The default form-embed code looks like this

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
 hbspt.forms.create({
 region: "na1",
 portalId: "XXX",
 formId: "XXXXXX-XXXXXX-XXXXXXXX"
 });
</script>

```

with a onFormSubmit addition it would look like this

```lia-code-sample
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
 hbspt.forms.create({
 region: "na1",
 portalId: "XXX",
 formId: "XXXXXX-XXXXXX-XXXXXXXX",
 onFormSubmit:{
 //your Rudderstack tracking action
 }
 });
</script>

```

hope that helps,

best,

Anton
