{"id":3177,"date":"2023-07-13T13:35:52","date_gmt":"2023-07-13T13:35:52","guid":{"rendered":"https:\/\/obo.zoj.mybluehost.me\/uncategorized\/hubspot-embed-hubspot-forms-in-ion\/"},"modified":"2025-02-17T11:53:34","modified_gmt":"2025-02-17T11:53:34","slug":"hubspot-embed-hubspot-forms-in-ion","status":"publish","type":"post","link":"https:\/\/ioninteractive.com\/ionacademy\/hubspot-embed-hubspot-forms-in-ion\/","title":{"rendered":"HubSpot: Embed HubSpot forms in ion"},"content":{"rendered":"<p>If you\u2019d like to embed HubSpot forms into your ion experiences, check out this post to easily repurpose your HubSpot embed code into a reusable ion widget. Taking these steps will enable you to redirect respondents to an ion page after form submission and to add ion rule logic to your HubSpot forms.<\/p>\n<h3><strong>Before we begin<\/strong><\/h3>\n<p>Before setting up a HubSpot form widget in ion, you will want to understand where to find your HubSpot portal ID and the form ID of the HubSpot form(s) you want to add to your ion pages.<\/p>\n<p>Your HubSpot portal ID is a numeric value that is always present in the URL of every page within your HubSpot account. For example, when reviewing contacts in your HubSpot account, your URL should look something like the below. In this example, we\u2019ve made the portal ID bold to make it easy to identify the portal ID.<\/p>\n<pre>https:\/\/app.hubspot.com\/contacts\/<strong>123456<\/strong>\/contacts<\/pre>\n<p>&nbsp;<\/p>\n<p>You\u2019ll also need to understand where to find your form IDs. The form ID is a longer alpha-numeric string that you will see in the URL when editing your HubSpot form or viewing form performance in HubSpot. Please find examples below of URLs you will see in your address bar when editing a HubSpot form or viewing performance with the form ID bold.&nbsp;<\/p>\n<p><strong>Edit Form<\/strong>:<\/p>\n<pre><a href=\"https:\/\/app.hubspot.com\/forms\/123456\/editor\/a1bbbcd2-345b-1234-1234-1a23b456c789\/edit\/form\" rel=\"noopener\">https:\/\/app.hubspot.com\/forms\/123456\/editor\/<strong>a1bbbcd2-345b-1234-1234-1a23b456c789<\/strong>\/edit\/form<\/a><\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Form Performance<\/strong>:<\/p>\n<pre><a href=\"https:\/\/app.hubspot.com\/forms\/123456\/a1bbbcd2-345b-1234-1234-1a23b456c789\/performance\" rel=\"noopener\">https:\/\/app.hubspot.com\/forms\/123456\/a1bbbcd2-345b-1234-1234-1a23b456c789\/performance<\/a><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Let\u2019s get started<\/strong><\/h3>\n<p>Now that you know where to find your HubSpot portal ID and form ID values, we can start working on the form widget in ion. You can put your portal ID and form ID values to the side for now until it\u2019s time to add your HubSpot form widget to a page.<\/p>\n<h4><strong>Add widget code to your ion library<\/strong><\/h4>\n<p>The first step in ion is to add the below code to your ion Widget Library.<\/p>\n<p>In ion, navigate to <strong>Libraries<\/strong> <strong>&gt;<\/strong> <strong>Widgets<\/strong> and click the <strong>New widget<\/strong> button to add a new widget. We recommend labeling the widget something like Embed Form and storing it in a category called HubSpot.&nbsp;<\/p>\n<p>Next, paste the widget code below into the editor.<\/p>\n<pre>&lt;<strong>script<\/strong> src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.5.1\/jquery.min.js\"&gt;&lt;\/<strong>script<\/strong>&gt;\n&lt;!--[if lte IE 8]&gt;\n&lt;script charset=\"utf-8\" type=\"text\/javascript\" src=\"\/\/js.hsforms.net\/forms\/v2-legacy.js\"&gt;&lt;\/script&gt;\n&lt;![endif]--&gt;\n&lt;<strong>script<\/strong> charset=\"utf-8\" type=\"text\/javascript\" src=\"\/\/js.hsforms.net\/forms\/v2.js\"&gt;&lt;\/<strong>script<\/strong>&gt;\n&lt;<strong>script<\/strong>&gt;\nhbspt.forms.create({\nportalId: '##portalId',\nformId: '##formId',\n&nbsp; onFormSubmitted: function($form) {\ntop.location.href = '##OnSubmittedUrl'\n},\n});\n&lt;\/<strong>script<\/strong>&gt;<\/pre>\n<p>This code includes variables that you will be able to populate with your portal ID and form ID when the time comes to add it to your page. It also includes a variable that will allow you to specify what page to go to when the form is submitted.<\/p>\n<p>Before saving, go ahead and set the <strong>Portal ID<\/strong> and F<strong>orm ID<\/strong> as required text and <strong>Next Page<\/strong> as a required action, like the example below:<\/p>\n<p><img decoding=\"async\" class=\"hs-image-align-none\" src=\"https:\/\/obo.zoj.mybluehost.me\/wp-content\/uploads\/2023\/08\/image-png-Jul-13-2023-01-35-43-6267-PM.png\" loading=\"lazy\"><\/p>\n<p>&nbsp;<strong>Add the widget to your ion experience<\/strong><\/p>\n<p>Navigate to the page where you&#8217;d like to embed the HubSpot form. Drag the <strong>Widget<\/strong> icon from the <strong>Basics<\/strong> palette onto your page and select your new <strong>HubSpot<\/strong> <strong>&gt;<\/strong> <strong>Embed Form widget<\/strong>. Next, under <strong>Variables<\/strong> in Creative studio, enter the <strong>portal ID<\/strong> and <strong>form ID, in the Source text option,<\/strong> from your HubSpot account and select the ion page you seek to redirect to.<\/p>\n<p>Voila! Your HubSpot form is now embedded in your ion experience! You can even add ion rule logic to your HubSpot form.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019d like to embed HubSpot forms into your ion experiences, check out this post to easily repurpose your HubSpot embed code into a reusable ion widget. Taking these steps will enable you to [&hellip;]<\/p>\n","protected":false},"author":21,"featured_media":5350,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[2175,2078],"tags":[2173,2200,2216,2208],"class_list":["post-3177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ion-integrations-the-advanced-capabilites","category-the-advanced-capabilites","tag-advanced","tag-data-management","tag-hubspot","tag-ion-integration"],"_links":{"self":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/comments?post=3177"}],"version-history":[{"count":1,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3177\/revisions"}],"predecessor-version":[{"id":5351,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/posts\/3177\/revisions\/5351"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/media\/5350"}],"wp:attachment":[{"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/media?parent=3177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/categories?post=3177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ioninteractive.com\/ionacademy\/wp-json\/wp\/v2\/tags?post=3177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}