Hubspot form disappearing

SOLVE
FinestNinja
Member

Hi community,

 

I had 2 Hubspot forms on my website and they were working just fine for a few days. Yesterday they disappear from the site and it has caused trouble for people wanting to contact us. I've checked the form settings and there's nothing weird about them. What are the reasons and how could I fix it?

0 Upvotes
1 Accepted solution

Accepted Solutions
MatthewShepherd
Solution
HubSpot Employee

Hi @FinestNinja 

There are quite a few reasons a form could stop showing on a page. Here are some things to look at:

 

  • Check your form embed code is still correct.
  • Check if your forms are loading when viewing the site in another browser. Sometimes browser extensions or ad blockers can prevent forms from loading.
  • Make sure javascript is enabled in your browser.
  • Check if your website is showing any javascript errors (in the browser console), such errors can sometimes block Hubspot forms from loading properly.
  • Look at your page source code (CTRL+U and search, CTRL+F, for <form ) and check if you can the form code in your page's code. This might help you figure out if the form is being hidden with CSS or something similar.

If you can share a URL of a page with this issue I can take a look and see if I can see what the problem is.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

22 Replies 22
MatthewShepherd
Solution
HubSpot Employee

Hi @FinestNinja 

There are quite a few reasons a form could stop showing on a page. Here are some things to look at:

 

  • Check your form embed code is still correct.
  • Check if your forms are loading when viewing the site in another browser. Sometimes browser extensions or ad blockers can prevent forms from loading.
  • Make sure javascript is enabled in your browser.
  • Check if your website is showing any javascript errors (in the browser console), such errors can sometimes block Hubspot forms from loading properly.
  • Look at your page source code (CTRL+U and search, CTRL+F, for <form ) and check if you can the form code in your page's code. This might help you figure out if the form is being hidden with CSS or something similar.

If you can share a URL of a page with this issue I can take a look and see if I can see what the problem is.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional

View solution in original post

FinestNinja
Member

Thank you Matthew for your help! I appreciate it a lot!

MatthewShepherd
HubSpot Employee

Perfect, you found the issue then?


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
E32crew
Member

Hi, we are having the exact same issue site-wide right now. All of our contact forms show up then they disappear immediately. One example with our Contact Us page - https://www.robomq.io/about-us/#contact

 

I have followed all of these steps here you have shared, but these don't seem to be the issue. 

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @E32crew 

Your Hubspot contact form is displaying and stays on the page for me. I did notice that you have a few javascript errors, including what looks like an unpublished Google Tag Manager container and two copies of your Google Tag Manager script on one page.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
E32crew
Member

Thank you, I see it is working now. Our team worked behind the scenes on it and did mention that some of the HubSpot Form Iframe CSS property was not working for Chrome browser so they were able to add it manually. 

 

I will also forward this info to them as well. 

dformica
Contributor

Hi,

 

Would you please be able to share how you managed to get the hubspot form to stay in place?  We are also having the form disappear to the left after the page loads.   

 

Thanks!

0 Upvotes
MatthewShepherd
HubSpot Employee

@dformica 
Can you share the URL to the page where your form is displaying incorrectly?


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
dformica
Contributor

The form looks fine with the share link: https://share.hsforms.com/1HhVvj9UfRRyIy3yWFljAtw4o9bp

 

The form included in WordPress 5.4.2 as below:

[hubspot type=form portal=7850293 id=d98ae05f-d6a8-450e-a385-155f4f72b25d]

 

Causes the page to load then disappear as shown on this quick video:   https://www.dropbox.com/s/xb3vzyf2hw1u2s7/hubspot-form-dissapears.webm?dl=0

Capture.JPG

 

 

I want to keep from including the page as an iframe.  I wonder if that's my only option at this point?

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @dformica 


That's strange it seems like the element containing the form is gradually getting reduced in width as the page loads. I wonder if this could be a series of conflicting stylesheet rules or if other elements around the form are loading in and reducing the width available to the form container. The only way to tell for sure is if I can look at the code of the page as it loads. Can you share a URL to the page (you can message me privately if you'd like) or do you only have a local copy?

Thanks,
Matthew


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
dformica
Contributor

This is what the theme developer had to say:

 

We checked that issue but it from Hubspot end third party API.
Can you please check with their support team, they will help you with this.
During page load it shows "v2.js:14 Please, pass a portal id and form id to render your HubSpot form" error.
May be due to that its hide after complete page load.
 
Please, let me know if that makes sense to you?  Or if you have any suggestions for me, please.
0 Upvotes
MCuzmaCépeda
Member

Hey Matthew,

 

we are having the same issue. Our Forms dissapears 3 days ago and nobody changed a line of code.

Could you please have a look at https://monikacuzmacepeda.com/netzwerktreffen/

The problem is in chrom, safari, iphone, different IP´s and Laptops. 

We can see the code in the backend and checked it again. The Chat-Support could not help.

Java should also be fine.

 

Hope you can help.

 

Tx 😉

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @MCuzmaCépeda 

I took a quick look and didn't see any obvious issues that would cause this. I see the form script on your page but that isn't rendering a form. A few questions and suggestions:

 

  • How are you embedding the form in WordPress i.e. using a shortcode or the full embed code?
  • If you are using the HubSpot Worpdress plugin to embed the form have you tried just using the full embed code?
  • I see you are using a caching plugin, maybe WP Optimize, can you try purging the plugin's cache?
  • I see you are using a Cookie control plugin. Have any changes been made in your Cookie control settings?

Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
MCuzmaCépeda
Member

Hi Matthew,

 

thanks a lot for checking our page.

I´ll answer in your text.

 

  • How are you embedding the form in WordPress i.e. using a shortcode or the full embed code? - the full embed code ... but after the form dissapeared we also tried the shortcode and changed it back to the full embeded code.
  • If you are using the HubSpot Worpdress plugin to embed the form have you tried just using the full embed code? - yes we are using the HubSpot WP Plugin and did so. The form worked for many weeks/months and suddenly it dissapeared without any changes.
  • I see you are using a caching plugin, maybe WP Optimize, can you try purging the plugin's cache? - we have already done it but unfortunately without success.
  • I see you are using a Cookie control plugin. Have any changes been made in your Cookie control settings? - we didn´t change the cookie control.

Also: Everything is updated ... WP, Licence, Plugins 

 

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @MCuzmaCépeda 
I'm seeing differences between the form creation code inserted into your site via the HubSpot WordPress plugin compared to a fresh install I did on a test site. Here's what my test code looks like:

 

 

			<!-- DO NOT COPY THIS SNIPPET! Start of Page Analytics Tracking for HubSpot WordPress plugin v8.0.227-->
			<script type="text/javascript">
				var _hsq = _hsq || [];
				_hsq.push(["setContentType", "standard-page"]);
			</script>
			<!-- DO NOT COPY THIS SNIPPET! End of Page Analytics Tracking for HubSpot WordPress plugin -->
						<script>
				(function() {
					var hbspt = window.hbspt = window.hbspt || {};
					hbspt.forms = hbspt.forms || {};
					hbspt._wpFormsQueue = [];
					hbspt.enqueueForm = function(formDef) {
						if (hbspt.forms && hbspt.forms.create) {
							hbspt.forms.create(formDef);
						} else {
							hbspt._wpFormsQueue.push(formDef);
						}
					}
					if (!window.hbspt.forms.create) {
						Object.defineProperty(window.hbspt.forms, 'create', {
							configurable: true,
							get: function() {
								return hbspt._wpCreateForm;
							},
							set: function(value) {
								hbspt._wpCreateForm = value;
								while (hbspt._wpFormsQueue.length) {
									var formDef = hbspt._wpFormsQueue.shift();
									if (!document.currentScript) {
										var formScriptId = 'leadin-forms-v2-js';
										hubspot.utils.currentScript = document.getElementById(formScriptId);
									}
									hbspt._wpCreateForm.call(hbspt.forms, formDef);
								}
							},
						});
					}
				})();
			</script>

 

 


Your form script code looks like this

 

 

 <script type="text/javascript">var _hsq=_hsq||[];_hsq.push(["setContentType","standard-page"])</script>  <script>(function(){var hbspt=window.hbspt=window.hbspt||{};hbspt.forms=hbspt.forms||{};hbspt._wpFormsQueue=[];hbspt.enqueueForm=function(formDef){if(hbspt.forms&&hbspt.forms.create){hbspt.forms.create(formDef)}else{hbspt._wpFormsQueue.push(formDef)}}
if(!window.hbspt.forms.create){Object.defineProperty(window.hbspt.forms,'create',{configurable:!0,get:function(){return hbspt._wpCreateForm},set:function(value){hbspt._wpCreateForm=value;while(hbspt._wpFormsQueue.length){var formDef=hbspt._wpFormsQueue.shift();if(!document.currentScript){var formScriptId='leadin-forms-v2-js';hubspot.utils.currentScript=document.getElementById(formScriptId)}
hbspt._wpCreateForm.call(hbspt.forms,formDef)}},})}})()</script>

 

 


Running through the code I see some pieces of the code missing. If you have recently updated your HubSpot plugin, my next guess is that the WP-Optimize plugin is altering your code. If you can, I would suggest disabling HTML / Javascript minification and/or disabling the plugin to see if that is causing the issue (on a test site if possible). Also, on https://monikacuzmacepeda.com/netzwerktreffen, I don't see the actual form embed code which would look something like this:

 

 

					<script>
						hbspt.enqueueForm({
							portalId: 12345678,
							formId: "a30ce37e-a1a6-4b29-a896-189ec1d23553",
							target: "#hbspt-form-1623230060000-1779843313",
							shortcode: "wp",
							
						});
					</script>
					<div class="hbspt-form" id="hbspt-form-1623230060000-1779843313"></div>

 

 


If you have embedded that code in this page then something must be stripping that out also. Again WP-Optimize could be the culprit, but if not, I would suggest checking for conflicting plugins. Recent updates to other plugins can sometimes cause conflicts and unexpected behaviour.


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
MCuzmaCépeda
Member

Hey Matthew,

 

thanks for your reply. Unforunately nothings helps. I deactivated every single Plugin but still the same problem.

The first picture shows the code from HubSpot Backend.

The second one shows the code we put in our instllation. They are the same and once again nobody changed a line the last few months.

It was okay for months and suddenly the form dissapeared.

A mystery.

 

Bildschirmfoto 2021-06-10 um 13.01.42.pngBildschirmfoto 2021-06-10 um 13.01.21.png

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @MCuzmaCépeda 

Could you

 

  1. Temporarily disable the HubSpot WordPress and WP Optimize plugins
  2. Put that form embed code in to your page
  3. Let me know how you embedded the form i.e. in legacy/Gutenberg editor, in which kind of block.
  4. Share the page you embedded the form on and where on the page the form should appear?

 


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
MCuzmaCépeda
Member

Hi Matthew,

 

1. both plugins are inactive now.

2. the page is https://monikacuzmacepeda.com/netzwerktreffen/

3. editor is avia layout architekt

 

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi

 

Thanks. Yes, I don't see the code appearing on the page, so I'm wondering if Avia Layout Architect is stripping it out. Are you placing the embed code in a text block element or code block within the layout editor? I found this article that discusses using a code block for embed codes in the Avia Layout builder (this video might help too). If it isn't already try placing the embed code in a code block in your page.

 


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
0 Upvotes
MCuzmaCépeda
Member

As you can see it is and allways was embeded in a code block. That´s really strange...

that´s why we are wondering about why it suddenly happened like this.

 

 

Bildschirmfoto 2021-06-10 um 18.18.17.pngBildschirmfoto 2021-06-10 um 18.18.39.png

0 Upvotes
MatthewShepherd
HubSpot Employee

Hi @MCuzmaCépeda 
That is strange. That code is definitely not being output to the page

 

MatthewShepherd_0-1623400345180.png

 

It looks like this could be an issue with the layout editor/theme. It's probably worth reaching out to the theme developers to see if they can help troubleshoot this.

 


Matthew Shepherd

Senior Inbound Consultant

Professional Services | HubSpot

He/Him

linkedin.com/in/matthewshepherd/
https://www.hubspot.com/services/professional
MCuzmaCépeda
Member

Hi Matthew,

 

yes that´s strange. I´ll get in touch with the theme developer. Hope that will work 😉 Thanks a lot for your help.