Would using the v3 embed link be an issue? (instead of v2)

ONg
メンバー

The embed for a form is as such:

 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxx",
    formId: "xxxxx"
  });
</script>

 

 

... Just wondering instead of using //js.hsforms.net/forms/embed/v2.js, would using //js.hsforms.net/forms/embed/v3.js be ok?

Context: We embedded the form with no issues as an iframe, but we need it as a raw HTML form instead. After switching it to a HTML form, the captcha on the form stopped working. 

 

Stumbled upon this post: https://community.hubspot.com/t5/APIs-Integrations/Forms-Api-Captcha-Handling/m-p/248800 ... tried the v3 link and it worked properly. Contacted Hubspot Support to see if it's a viable solution, and they told me to ask the question here instead so here I am.

 

Would this v3 link be okay? 

 

0 いいね!
2件の承認済みベストアンサー
p6l-richard
解決策
参加者

I think so.. looks like the form will try to fetch `/embed/v3/form/<portal_id>/<form_id>/json` and that errors:

I just received this response:
```json
{
"status": "error",
"message": "You cannot fetch this type of form using this endpoint. Not an Embed version 2 or 3 form",
"correlationId": "a408499a-..."
}
```

Although it does render the form somehow.

元の投稿で解決策を見る

Anton
解決策
ソートリーダー | Solutions Partner
ソートリーダー | Solutions Partner

As far as I know:

V2 is for forms built with what's being called "Legacy forms" now, while v4 (there's no official v3) is for the new form editor. 

 

If you want to get the raw HTML of a legacy form, you can modify the embed code slightly from 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxx",
    formId: "xxxxx"
  });
</script>

to

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxx",
    formId: "xxxxx", 
    css:""
  });
</script>

 

By adding the css:"", the form is being rendered as plain HTML without any inherited styles from HubSpot.

 

Hope this helps

 

 

best, 

Anton

 

Anton Bujanowski Signature

元の投稿で解決策を見る

0 いいね!
5件の返信 5
Anton
解決策
ソートリーダー | Solutions Partner
ソートリーダー | Solutions Partner

As far as I know:

V2 is for forms built with what's being called "Legacy forms" now, while v4 (there's no official v3) is for the new form editor. 

 

If you want to get the raw HTML of a legacy form, you can modify the embed code slightly from 

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxx",
    formId: "xxxxx"
  });
</script>

to

<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
  hbspt.forms.create({
    region: "na1",
    portalId: "xxxxx",
    formId: "xxxxx", 
    css:""
  });
</script>

 

By adding the css:"", the form is being rendered as plain HTML without any inherited styles from HubSpot.

 

Hope this helps

 

 

best, 

Anton

 

Anton Bujanowski Signature
0 いいね!
SApostolov
参加者

I have the same problem,
Did support help you?

0 いいね!
ONg
メンバー

Support didn't help me, but I went ahead and used v3 anyway with no problems. At your own risk. We monitored the form closely to make sure there weren't any issues and it was ok until we switched to the newer form.

0 いいね!
BérangèreL
コミュニティーマネージャー
コミュニティーマネージャー

Hi @SApostolov and thanks for your question!

As of now, the documentation only references //js.hsforms.net/forms/embed/v2.js as the standard embed script URL, there isn’t any official guidance about using v3 at this time.
 

Regarding CAPTCHA, there are some limitations when handling CAPTCHA with raw HTML forms and the Forms API.

Form submissions via the API that include CAPTCHA tokens may return errors, so we recommend implementing your own spam protection system before sending data through the API.

Hi @Anton, @MichaelMa and @SteveHTM, what are your thoughts on this, please?

Thanks so much and have a lovely day!
Bérangère

This post was created with the assistance of AI tools





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 いいね!
p6l-richard
解決策
参加者

I think so.. looks like the form will try to fetch `/embed/v3/form/<portal_id>/<form_id>/json` and that errors:

I just received this response:
```json
{
"status": "error",
"message": "You cannot fetch this type of form using this endpoint. Not an Embed version 2 or 3 form",
"correlationId": "a408499a-..."
}
```

Although it does render the form somehow.