Lead Capture Tools


Non-HubSpot form URL Redirection not working



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:



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.


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.



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.

1 Reply 1
Recognized Expert | Diamond Partner
Recognized Expert | 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?

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