# Signup with Forms API creates duplicated forms submissions + extra form views

**URL:** <https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [October 24, 2018, 3:10pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314 "2018-10-24T15:10:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eugene1/32/28756_2.png) [@Eugene1](https://community.hubspot.com/u/Eugene1)\
**Post date:** [October 24, 2018, 3:10pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/1 "2018-10-24T15:10:00Z")

</div>

Hi,

We’ve build [our signup](https://signup.pandadoc.com) with the help of Forms API. ID of form is 52f5b5fb-c135-403d-8a68-afd5477d4922

Our signup is multi-step.

When I look at form submissions and form views I see that there are duplicated submissions + submission rate is super high. Does each step of our signup is counted as form submission? If yes, how we can fix it?

Also does each step create view in analytics?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 25, 2018, 12:20pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/2 "2018-10-25T12:20:35Z")

</div>

Hi [@Eugene](https://community.hubspot.com/u/eugene),

What is your Hub ID? The form ID doesn’t help me much on its own.

To my knowledge, form views and submission rates are only calculated for native or embedded HubSpot forms — not through the Forms API. Could you please share a link to the form in your portal so I can investigate further?

---

<div class="post-metadata">

**Author:** ![Eugene1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eugene1/32/28756_2.png) [@Eugene1](https://community.hubspot.com/u/Eugene1)\
**Post date:** [October 25, 2018, 12:30pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/3 "2018-10-25T12:30:34Z")

</div>

Sure, here it is: [Forms | HubSpot](https://app.hubspot.com/forms/2127247/editor/52f5b5fb-c135-403d-8a68-afd5477d4922/edit/form)

---

<div class="post-metadata">

**Author:** ![Eugene1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eugene1/32/28756_2.png) [@Eugene1](https://community.hubspot.com/u/Eugene1)\
**Post date:** [October 29, 2018, 1:08pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/4 "2018-10-29T13:08:39Z")

</div>

[@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi)  
Have you seen my answer?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [October 29, 2018, 6:08pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/5 "2018-10-29T18:08:26Z")

</div>

Thanks for tagging me, [@Eugene](https://community.hubspot.com/u/eugene).

My tests confirm that each form step logs a separate submission. As a result, [this test contact](https://app.hubspot.com/contacts/2127247/contact/144747495/?interaction=note) has three submission events but [this test contact](https://app.hubspot.com/contacts/2127247/contact/144748318/?interaction=note) only has two because I didn’t complete the process.

You can prevent this behavior by sending _all_ the form data to the [Forms API](https://developers.hubspot.com/docs/methods/forms/submit_form) at the end instead of after each step. Since you are using the v2 Forms API endpoint, you must be sending data to your server already, so you should be able to combine all submitted fields into a single payload.

A form view is counted when the form embed code loads. I can see an embedded but hidden form in [this page’s](https://signup.pandadoc.com/) source code. During my test submissions, I did not see the code load again, so I do not believe each step creates a new view in analytics.

---

<div class="post-metadata">

**Author:** ![Eugene1](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/eugene1/32/28756_2.png) [@Eugene1](https://community.hubspot.com/u/Eugene1)\
**Post date:** [October 30, 2018, 3:35pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/6 "2018-10-30T15:35:28Z")

</div>

Thanks for your help [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi)

Got it about views.

But if to speak about submissions: we need data about users only if they fill in first step. Is it possible to record data on each step, but not create duplicated submissions?

Thanks,  
Eugene

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [November 2, 2018, 2:37pm UTC](https://community.hubspot.com/t/signup-with-forms-api-creates-duplicated-forms-submissions-extra-form-views/11314/7 "2018-11-02T14:37:51Z")

</div>

Hi [@Eugene](https://community.hubspot.com/u/eugene),

The only way to prevent multiple submissions is to make _one_ Forms API call per visitor. Multiple calls will create multiple submissions.

As such, you could store each step’s submission data client-side and then retrieve and send it to HubSpot when the visitor either completes all steps _or_ leaves your site.

Here are some options I have found:

**Store submission data with JavaScript** :

- [How to store HTML form input as JavaScript Object | Stack Overflow](https://stackoverflow.com/questions/31332316/how-to-store-html-form-input-as-javascript-object) (You could then submit the complete object in one call.)
- [Client-side storage | MDN](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Client-side_web_APIs/Client-side_storage)

**Call functions before visitor leaves page** :

- `onbeforeunload` | [W3Schools documentation](https://www.w3schools.com/jsref/event_onbeforeunload.asp)
- `beforeunload` | [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/Events/beforeunload)
- Related Stack Overflow discussions: [1](https://stackoverflow.com/questions/28627111/how-to-call-a-function-before-leaving-page-with-javascript) | [2](https://stackoverflow.com/questions/10272561/ajax-and-user-leaving-a-page)
