Ignore a specific non-Hubspot form from being collected

SOLVE
Highlighted
Regular Contributor

Hey there!

 

Is there an option to keep the "Collect data from website forms" option enabled, but to somehow mark a few forms to be skipped by the Hubspot form tracking JS code?

I vaguely recall there was some markup feature, but, for the life of me, I can't find any evidence to that.

2 Accepted solutions

Accepted Solutions
Regular Contributor

Well, while we're at it and I don't have a blog to post it to, there is a way to exclude a specific form from being collected.

 

What you need to do is add the following code to it:

<label for="amex" style="display:none">AMEX</label>
<input type="hidden" name="amex" required="" value="" id="amex">

HS JS tracking code will deem your form as one that contains sensitive data and will ignore it. 

Regular Contributor

I've gone and looked at the source for collected-forms.js

They check for the following labels:

, s = ["credit card", "card number", "expiration", "expiry", "ccv", "cvc", "cvv", "secure code", "mastercard", "american express", "amex"]

and the following for names:
, c = ["cc-num", "cc-number"]

 

in a function called isSensitive which is used in a function called rejectIfAnyFieldSensitive

 

So I've managed to get the form to not submit with the following markup:

 

    <label for="cc-num" class="hidden">credit card HubspotCollectedFormsWorkaround https://community.hubspot.com/t5/APIs-Integrations/How-to-stop-collected-forms-from-collecting-a-form/m-p/299172#M28102</label>
    <input name="cc-num" class="hidden" required="" value="HubspotCollectedFormsWorkaround" id="cc-num">

Would be great if this could be added to the documentation 

 

10 Replies 10
Community Manager

Hi @balabanov ,

 

Because non-HubSpot forms requires HubSpot to crawl for all of the forms on your site there is no way to turn it off for certain pages or forms. 

 

For more information, I wanted to share these resources: 

1. Using non-hubspot form

2. non-hubspot forms FAQ

 

Thanks,
Jenny


Did my post help answer your query? Help the Community by marking it as a solution
Reply
0 Upvotes
Regular Contributor

Well, while we're at it and I don't have a blog to post it to, there is a way to exclude a specific form from being collected.

 

What you need to do is add the following code to it:

<label for="amex" style="display:none">AMEX</label>
<input type="hidden" name="amex" required="" value="" id="amex">

HS JS tracking code will deem your form as one that contains sensitive data and will ignore it. 

Regular Contributor

Hi @balabanov 

 

Does this technique still work for you? It doesnt seem to work for me.

 

I've also noticed that since August 2019, Hubspot collected forms is now collecting dynamically creating forms in contravention of their documenation here: https://knowledge.hubspot.com/forms/use-non-hubspot-forms

Reply
0 Upvotes
Regular Contributor

This workaround from @balabanov didn;t work for me but I managed to get a variation of it working for me

 

.hidden {
  display: none;
}

<label for="credit-card" class="hidden">HubspotCollectedFormsWorkaround https://community.hubspot.com/t5/APIs-Integrations/How-to-stop-collected-forms-from-collecting-a-form/m-p/299172#M28102</label>
   
<input name="credit-card" class="hidden" required="" value="HubspotCollectedFormsWorkaround" id="credit-card">
Reply
0 Upvotes
Regular Contributor

Actually that doesnt work in our produciton environment.

 

Still unable to block form submission for forms with private info Smiley Sad

Reply
0 Upvotes
Regular Contributor

I've gone and looked at the source for collected-forms.js

They check for the following labels:

, s = ["credit card", "card number", "expiration", "expiry", "ccv", "cvc", "cvv", "secure code", "mastercard", "american express", "amex"]

and the following for names:
, c = ["cc-num", "cc-number"]

 

in a function called isSensitive which is used in a function called rejectIfAnyFieldSensitive

 

So I've managed to get the form to not submit with the following markup:

 

    <label for="cc-num" class="hidden">credit card HubspotCollectedFormsWorkaround https://community.hubspot.com/t5/APIs-Integrations/How-to-stop-collected-forms-from-collecting-a-form/m-p/299172#M28102</label>
    <input name="cc-num" class="hidden" required="" value="HubspotCollectedFormsWorkaround" id="cc-num">

Would be great if this could be added to the documentation 

 

Occasional Contributor

is still no option to ignore some forms from the site?

Regular Contributor

Hi @jennysowyrda ,

 

Saying that hubspot has to crawl for all forms on a site, so there is no way to turn it off for certain pages or forms doesnt make any sense.

 

They could easily exclude forms that have a particular data attribute or class on the form.

It doesnt make any sense for Hubspt to crawl all the forms and not have a way to mark some as private. This is resulting in a violation of GDPR as forms containing private information are being submitted

Reply
0 Upvotes
Community Manager

Hi @ianpetzer,

 

Thank you for reaching out. It will be your responsibility to ensure your forms comply with the law. I would recommend partnering with your legal team to ensure your forms are GDPR compliant. Additionally, HubSpot does not accept sensitive information through our forms. Please ensure that all form fields are compliant with our terms of use.

 

Thank you,
Jenny


Did my post help answer your query? Help the Community by marking it as a solution
Reply
0 Upvotes
Regular Contributor

Hi @jennysowyrda ,

 

0ur forms are GDPR compliant. The problem is this: 

 

1) A site include Hubspot collected-forms.js which causes all forms to be collected

2) On 01/29 you sadi that you cannot specify which forms to be collected, and I quote: "Because non-HubSpot forms requires HubSpot to crawl for all of the forms on your site there is no way to turn it off for certain pages or forms. :

3) This means that Hubspot is collecting sensitive data such as passport information, date of birth and address

4) Based on the workaround suggested by @balabanov , I have read through the source code and posted more information about how you can block the submission of forms by adding a fake input field with a specified name or label

5) It is up to Hubspot to add functionality to block the collection of certain forms or at least add documentaiton on how to block form collection using the workaroudn suggested above.

6) Right now, the collection of forms is blocked by the following labels:  ["credit card", "card number", "expiration", "expiry", "ccv", "cvc", "cvv", "secure code", "mastercard", "american express", "amex"]

7) As you can see this is not an exahaustive list of sensitive information. For example addresses and passport numbers and date of births are not considered sensitive

8) The current collected-forms.js implementaiton is flawed because it is not documented how to label/name the sensitve form fields to block submission without reading the source code and the list is not comprehensive enough. 

Reply
0 Upvotes