Lead Capture Tools

Cweb
Mitglied

Non-HubSpot form URL Redirection not working

Hi,

 

I have created a form and I am using the the simple embed code

<script type="text/javascript" id="hs-script-loader" async defer src="//js.hs-scripts.com/########.js"></script>

 

Page Link where the form is integrated:

http://carapacetechnologies.com/best-web-designing-company_2

 

But when the user fills up the form, on submission, the page does not redirect to the URL which is added in the hubspot form.

Even the redirect code available on the community post does not work.

 

<script>
hbspt.forms.create({
portalId: '#########',
formId: 'form_id',
inlineMessage: 'You are being redirected to the Application...',
onFormSubmit: function($form){

setTimeout( function() {
window.location.href = "https://carapacetechnologies.com/thank_you_LP";}, 500 ); // Redirects to url with query string data from form fields after 1/2 second.

}
});
</script>

 

Can anyone please help with this.

I am sure its just a very small tweak, but because I am new to Hubspot, so not able to find the fix.

 

Thanks in advance for the help.

0 Upvotes
1 Antwort
Teun
Trendsetter/-in | Diamond Partner
Trendsetter/-in | Diamond Partner

Non-HubSpot form URL Redirection not working

Hi @Cweb ,

 

I see two forms on your page. One at the top and one at the bottom.

Neither of those are HubSpot forms, they are written with HTML and not embedded with the embed code from HubSpot.

I also see that you did include the embed code, but that it gives an error. 

Did you copy the code from the HubSpot UI that shows when you publish a page?

 

In your case, it seems like you are trying to use custom forms with the tracking code. I do not think that is possible.

 

What are you trying to achieve?

Tracking your custom forms or embedding a HubSpot form?



Learn more about HubSpot by following me on LinkedIn or YouTube

Did my answer solve your issue? Help the community by marking it as the solution.