Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jtsternberg/f42689ed9c2258770c3b9efade5d97ac to your computer and use it in GitHub Desktop.
Save jtsternberg/f42689ed9c2258770c3b9efade5d97ac to your computer and use it in GitHub Desktop.
hubspot optinmonster custom html integration
<!--[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