Lead Capture Tools

balabanov
Contributor

Ignore a specific non-Hubspot form from being collected

SOLVE

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.

3 Accepted solutions
balabanov
Solution
Contributor

Ignore a specific non-Hubspot form from being collected

SOLVE

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. 

View solution in original post

ianpetzer
Solution
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

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 

 

View solution in original post

garrett9
Solution
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

I noticed that when you specify in HubSpot to collect info from non-HubSpot forms, it attempts to add the script collectedforms.js to your website. However, before doing so, it checks to see if it's already installed by using the document.getElementById method where the ID is CollectedForms-1234 (1234 is the ID at the end of your tracking script). Therefore, if you simply put any HTML element on your page with that ID, such as

<span id="CollectedForms-1234"></span>, it won't install the collectedforms.js file, meaning it also won't collect information on your non-HubSpot forms. While still a hack, it doesn't force you to change your forms, and it's much easier to conditionally add it based on where the user is in your app. Just be sure that this element exists statically on your website, and isn't loaded dynamically.

View solution in original post

38 Replies 38
JFuentesZ
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

Although this feature is not yet available. This is a workaround I found useful, but you need Pro or higher in order to access workflows:

Screenshot_3.png

Basically, trigger is to be any form submissions on your specific Non-Hubspot form. Then, in my case I inputed a timestamp simply because I want to review any contacts that got created before that timestamp. Yet it might not be needed if you need not review them.

 

After this, I simply added a small delay, and chose the option to Delete Contact as an action.

vserranoh
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

Thanks for sharing! 🙌

0 Upvotes
BDehlinger
Participant | Diamond Partner
Participant | Diamond Partner

Ignore a specific non-Hubspot form from being collected

SOLVE

Checking in on this - any chance we can select which non-hubspot forms we want to collect from in 2022? 

balabanov
Contributor

Ignore a specific non-Hubspot form from being collected

SOLVE

Nope 🙂

0 Upvotes
AnkitGandhi
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

I have a few WordPress forms that are integrated with hubspot.
I don't want to create a contact for a particular form. for instance, for a form on my career page - I don't want to include the submissions as a marketing contact.

 

Where do I add the above code? as I cannot edit any non-hubspot form.

0 Upvotes
garrett9
Solution
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

I noticed that when you specify in HubSpot to collect info from non-HubSpot forms, it attempts to add the script collectedforms.js to your website. However, before doing so, it checks to see if it's already installed by using the document.getElementById method where the ID is CollectedForms-1234 (1234 is the ID at the end of your tracking script). Therefore, if you simply put any HTML element on your page with that ID, such as

<span id="CollectedForms-1234"></span>, it won't install the collectedforms.js file, meaning it also won't collect information on your non-HubSpot forms. While still a hack, it doesn't force you to change your forms, and it's much easier to conditionally add it based on where the user is in your app. Just be sure that this element exists statically on your website, and isn't loaded dynamically.
NBorunda0
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Do you know if it will work if it's added dynamically but above the HS code?

0 Upvotes
FRaI
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Its now matching the TagName too, meaning the ID has to be in a <script> tag.

Inside the embeded https://js-na1.hs-scripts.com/1234.js:

var i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(n,i)}}("CollectedForms-1234",XY......

You have to specify it as follows, to not have it tracked by HubSpot:

<script id="CollectedForms-1234"></script>
<!-- stops Hubspot collection -->

Can you verify that too?

SGibbons5
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Is it possible to apply this with Google Tag Manager. What is the trigger? 

0 Upvotes
CParekh
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Strike what I asked below, definitely still valid! Thanks @garrett9 

 

Hi @garrett9 does the above fix still apply? I've tried looking for collectedforms.js or any elements with an id like "CollectedForms-" but can't find either in the source... 

vcheloudiakof
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

Thank's a lot, this solution solve my problem ! Please,this should be documented and used other than with a hack!

0 Upvotes
RLeo
Contributor | Diamond Partner
Contributor | Diamond Partner

Ignore a specific non-Hubspot form from being collected

SOLVE

This is the only solution that worked for me, the "hack" of inserting a label with a required field like "amex" and such, works partially... it doesnt register the submissions, but it still auto-creates the form on Hubspot, and notifications by email still arrive (weird).

 

Thank you very much garrett9!

pacoforet
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

This worked for us (Wordpress + Contact Form 7). The other solutions did not.

Daniesy
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

For those who want to do disable forms from being collected on specific Wordpress pages, the following code written in functions.php does the trick:

 

 

 

 

add_action( 'wp_footer', 'custom_wp_dequeue_script', 11 );
function custom_wp_dequeue_script() {
  if ( is_page('Page title') ) {
    wp_dequeue_script( 'leadin-script-loader-js' );
  }
}

 

 

 

 

ENasier
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Hi there,

 

Do you insert the full url in this section? if ( is_page(' page title ) 

 

?

 

0 Upvotes
RThomas6
Participant

Ignore a specific non-Hubspot form from being collected

SOLVE

This works well for one page. but I have 3 pages I need to remove these froms. Essentially we hire low wage workers and these days about 80% don't even show up for work so I don't want to add hundreds of people a month into Hubspot that don't serve a purpose.

0 Upvotes
PamCotton
Community Manager
Community Manager

Ignore a specific non-Hubspot form from being collected

SOLVE

Hello @Daniesy 

 

Thank you for sharing this solution!

 

Kindly,

Pam

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




Traxion-CW
Contributor

Ignore a specific non-Hubspot form from being collected

SOLVE

Would love to know if this is on the radar for being worked on. 

jennysowyrda
Community Manager
Community Manager

Ignore a specific non-Hubspot form from being collected

SOLVE

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

0 Upvotes
parinsanghvi
Member

Ignore a specific non-Hubspot form from being collected

SOLVE

Hi @jennysowyrda , 

Our website has clients dashboard login as well, we have implemented the hubspot tracking code on all pages of the website including the one which has the dashboard. We have several non-HubSpot forms in our dashboard that are not created in Hubspot. Now everytime a client fills one of those firms, Hubspot is capturing it and also sending an email for the same. How can we stop data getting collected from these forms automatically? 

0 Upvotes