Embedded form forcing URL Redirect in certain browsers

forms

#1

I have an embedded Hubspot form that’s setup to display inline thank you messages. When submitting the form in IE Edge 15 and Safari iOS 9+ (regardless of whether I’m emulating the user agent in Chrome or on a native device) the submission will force a redirect URL instead of displaying the inline thank you message. The form works as-expected in all other browsers.

Upon further investigation, I noticed the hidden input (name="hs_context") that stores the json value seems to add a redirectUrl value based on the userAgent. Below is sample output from the same form (which is setup to display an inline thank you message) rendering in two different browsers:

Chrome:

{
  "rumScriptExecuteTime": 2092.3100000000004,
  "rumServiceResponseTime": 2563.1600000000003,
  "rumFormRenderTime": 267.0150000000003,
  "rumTotalRenderTime": 2563.9200000000005,
  "rumTotalRequestTime": 261.9899999999998,
  "lang": "en",
  "pageUrl": "http://project.dev/news",
  "pageTitle": "News",
  "source": "FormsNext-static-1.575",
  "timestamp": 1506457877028,
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko",
  "referrer": "http://project-name.dev/news",
  "hutk": {},
  "originalEmbedContext": {
    "css": "",
    "portalId": "0000000",
    "formId": "2b465da9-1b5e-45a2-b220-7282fb965472",
    "target": ".newsletter-form",
    "redirectUrl": "",
    "inlineMessage": "Thanks for subscribing to our blog!"
  },
  "recentFieldsCookie": {},
  "boolCheckBoxFields": "",
  "dateFields": "",
  "redirectUrl": "",
  "smartFields": {},
  "urlParams": {},
  "formValidity": {},
  "correlationId": "e14b9f63-df16-4b40-b267-5058a5813e1a",
  "disableCookieSubmission": false,
  "usingInvisibleRecaptcha": false,
  "isFallback": false
}

IE Edge:

{
  "rumScriptExecuteTime": 1472.55,
  "rumServiceResponseTime": 1940.6050000000002,
  "rumFormRenderTime": 182.37499999999977,
  "rumTotalRenderTime": 1942.125,
  "rumTotalRequestTime": 179.5200000000002,
  "lang": "en",
  "pageUrl": "http://project-name.dev/news",
  "pageTitle": "News",
  "source": "FormsNext-static-1.575",
  "timestamp": 1506457937968,
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240",
  "referrer": "http://project-name.dev/news",
  "hutk": {},
  "originalEmbedContext": {
    "css": "",
    "portalId": "0000000",
    "formId": "2b465da9-1b5e-45a2-b220-7282fb965472",
    "target": ".newsletter-form",
    "redirectUrl": "http://project-name.dev/news?hsFormGuid=2b465da9-1b5e-45a2-b220-7282fb965472"
  },
  "recentFieldsCookie": {},
  "boolCheckBoxFields": "",
  "dateFields": "",
  "redirectUrl": "http://project-name.dev/news?hsFormGuid=2b465da9-1b5e-45a2-b220-7282fb965472",
  "smartFields": {},
  "urlParams": {},
  "formValidity": {},
  "correlationId": "79be6bad-2566-4a90-8f57-e2d3a4d541ab",
  "disableCookieSubmission": false,
  "usingInvisibleRecaptcha": false,
  "isFallback": false
}

Please advise on how to fix this issue.


#2

Hi @onedev,

This is actually the expected behavior of embedded forms at the moment. All HubSpot forms have historically refreshed the page/redirected to a page with the GUID in the url. We’re working on having an inline thank you message without forcing a page redirect but it currently only works on chrome and Firefox, which is why you’re seeing a discrepancy between browsers. The best solution would likely be to create your own custom form & submitting via the forms API.


#3

Hello @Derek_Gervais,

is there already another solution here? Custom forms are not an option!

Regards Marc


#4

Hi @MTSUWD,

This is still being worked on; I don’t have a timeline for this functionality.