Skip to content

Instantly share code, notes, and snippets.

@allanwhite
Last active May 6, 2024 05:19
Show Gist options
  • Save allanwhite/0c4af3630deb2ed9532a40e79c694966 to your computer and use it in GitHub Desktop.
Save allanwhite/0c4af3630deb2ed9532a40e79c694966 to your computer and use it in GitHub Desktop.
An example Hubspot form embed - top won't work in Statamic, bottom will. Seems like it must be minified.
hbspt.forms.create({portalId:"1695915",formId:"c5cbd91e-27da-4cb2-8bee-7ef37300c145",goToWebinarWebinarKey:"7245946950768380939",target:"#hsFormContainer",onFormSubmit:function(e){window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"GAEvent",eventCategory:"Webinar - See CCMS Live",eventAction:"Form Submission",eventLabel:"Registration",eventValue:"2"})},css:""});
<!--[if lte IE 8]>
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
<![endif]-->
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
<script>
hbspt.forms.create({
portalId: "1695915",
formId: "c5cbd91e-27da-4cb2-8bee-7ef37300c145",
goToWebinarWebinarKey: '7245946950768380939',
target: '#hsFormContainer',
onFormSubmit: function($form) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event' : 'GAEvent',
'eventCategory' : 'Webinar - See CCMS Live',
'eventAction' : 'Form Submission',
'eventLabel' : 'Registration',
'eventValue' : '2'
});
},
css: "",
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment