This is duplicating a quetion I asked in the developer Slack - bear with me…
I am developing a site using ASP.NET Web Forms, and in my Site.Master, I havve the following code:
<!-- Start of HubSpot Embed Code -->
<script type=“text/javascript” id=“hs-script-loader” async defer src=“//js.hs-scripts.com/XXXXX.js”></script>
<!-- End of HubSpot Embed Code -->
By doing so, the tracking scripts are placed on all the pages in the site. This is (somewhat obviously) an effect we want for tracking and chatbot purposes, however, we have also found that the scripts also insert Contact records automatically. We do not want this - we want to use the API for complete control of when a Contact is added to HubSpot.
Is there a way to disable this particular function in the scripts, or is this an all-or-nothing proposition?
Alternatively, you can try some of these other methods here
Form is not enclosed in <form> tags.
Form is contained inside <iframe> tags.
Form has JavaScript bound to the form submit event or submit button click event. This is how the tool captures submissions and any other events, and can prevent HubSpot from knowing when submissions occur.
Form was introduced after the page completed loading. The tool scans the page as soon as it loads and listens to submissions on forms that were present at that point.
Form contains a sensitive field, such as credit card number.
Form contains hidden fields. The tool does not collect information from any hidden fields.
The email field is not an email type input, as in: <input type="email">.
The form isn't using a standard <input type="submit"> button for its form submission. A generic HTML <button> will prevent HubSpot from capturing submissions.
@tjoyce On the suggestion: “Form contains a sensitive field, such as credit card number”. Are you saying that if the form being submitted has a sensitive field in it, the form data will be ignored, thus achieving the effect I want? If so, how do I define a field as “sensitive” (perhaps a newbie question…)?
I found the answer in another thread, despite this thread showing up first in SEO:
NonHS Forms on website(s) are automatically creating Contacts - How to stop?
This is probably because you are using our Non HubSpot Forms tool. You can toggle that off in Settings > Marketing > Forms > Non HubSpot Forms. You have more information on this in the following article:
This is a all-or-nothing tool. You cannot select some external forms but not the others. If this is something you really want to do, I’d advise to use our Forms API.