Created
April 28, 2021 21:31
-
-
Save jtsternberg/f42689ed9c2258770c3b9efade5d97ac to your computer and use it in GitHub Desktop.
hubspot optinmonster custom html integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--[if lte IE 8]--> | |
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script> | |
<![endif]--> | |
<script> | |
(function() { | |
var addForm = function() { | |
window.hbspt.forms.create({ | |
sfdcCampaignId: '70130000000ep2ZZZ', | |
portalId: '102310', | |
formId: '190ga042-56fc-4897-bed4-86ea519cb3e9', | |
target: '.FieldsElement--customHTML .customHtml .custom-hubspot-form', | |
onFormSubmit($form, ctx){ | |
om{{id}}.Listeners.convert(); | |
om{{id}}.changeView('success'); | |
} | |
}); | |
}; | |
if ( window.hbspt ) { | |
return addForm(); | |
} | |
// Inject the Hubspot script. | |
var script = document.createElement('script') | |
script.src = "//js.hsforms.net/forms/v2.js" | |
script.async = true | |
script.onload = addForm; | |
(document.getElementsByTagName('head')[0] || document.documentElement).appendChild(script) | |
})(); | |
</script> | |
<div class="custom-hubspot-form"></div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment