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!
Hiya,
My fix is still working for me. Your mileage may vary ![]()
Would love to know if this is on the radar for being worked on.
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.
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' );
}
}
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.
Hi there,
Do you insert the full url in this section? if ( is_page(’ page title )
?
This worked for us (Wordpress + Contact Form 7). The other solutions did not.
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!
Thank’s a lot, this solution solve my problem ! Please,this should be documented and used other than with a hack!
Is it possible to apply this with Google Tag Manager. What is the trigger?
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?
Do you know if it will work if it’s added dynamically but above the HS code?
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.
Checking in on this - any chance we can select which non-hubspot forms we want to collect from in 2022?
Nope ![]()
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:
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.
Thanks for sharing! ![]()
