Jan 22, 2019 8:09 AM
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.
Solved! Go to Solution.
Jan 30, 2019 5:42 AM
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.
Oct 29, 2019 6:45 AM
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
Sep 6, 2020 7:59 PM
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
Feb 22, 2022 2:28 PM
Checking in on this - any chance we can select which non-hubspot forms we want to collect from in 2022?
Feb 22, 2022 2:34 PM
Nope 🙂
Feb 8, 2022 1:27 AM
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.
Sep 6, 2020 7:59 PM
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
Jan 12, 2023 2:12 PM
Do you know if it will work if it's added dynamically but above the HS code?
Oct 4, 2022 5:06 AM
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?
May 24, 2022 3:07 PM
Is it possible to apply this with Google Tag Manager. What is the trigger?
Feb 4, 2022 11:36 AM - edited Feb 4, 2022 12:13 PM
Nov 17, 2021 8:56 AM
Thank's a lot, this solution solve my problem ! Please,this should be documented and used other than with a hack!
Oct 19, 2021 12:23 PM
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!
Nov 20, 2020 4:10 AM
This worked for us (Wordpress + Contact Form 7). The other solutions did not.
Sep 17, 2020 1:54 PM - edited Sep 17, 2020 6:13 PM
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' );
}
}
Apr 29, 2021 12:28 AM
Hi there,
Do you insert the full url in this section? if ( is_page(' page title )
?
Apr 26, 2021 11:50 AM
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.
Sep 17, 2020 3:44 PM
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 ! |
May 5, 2020 6:03 PM
Would love to know if this is on the radar for being worked on.
Jan 29, 2019 3:04 PM
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:
Thanks,
Jenny
Jul 1, 2020 5:31 AM
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?
Jul 1, 2020 7:50 AM
@parinsanghvi I posted a workaround higher up in this thread. https://community.hubspot.com/t5/Lead-Capture-Tools/Ignore-a-specific-non-Hubspot-form-from-being-co...
Simply include the hidden label and inout field into your form and Hubspot will ignore it.
Feb 9, 2021 12:01 PM
Hi there.... does your "fix" still apply? We are having big issues with this where hubspot forms are pulling data out of our web app that our customers are using. I just wanted to find out if this fix still works. Thanks so much!