Skip to content

Instantly share code, notes, and snippets.

@anorsich
Created February 9, 2020 08:18
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 anorsich/a4f0027cf0ba0e0f84c82a9f71521e2c to your computer and use it in GitHub Desktop.
Save anorsich/a4f0027cf0ba0e0f84c82a9f71521e2c to your computer and use it in GitHub Desktop.
An example of how to connect any form to Funnelfly.
// Documentation is available here https://docs.funnelfly.com/reference#section-on-form-submit
// The form is: https://www.babypalooza.com/contact-us/
// Form field names is used to get fields and map them to funnelfly fields.
// Funnelfly's custom fields are used to store inquery message, website and type.
<script type="text/javascript">
var form = document.getElementById('hsForm_c7ad58f4-b6df-4b48-bfa6-596cd823dbfd');
funnelfly.onFormSubmit(form, ({
email,
company,
firstname,
lastname,
phone,
website,
inquiry_type,
message,
}) => {
funnelfly.identify({
email,
firstName: firstname,
lastName: lastname,
phone,
company: {
name: companyName,
},
customFields: {
inquiryWebsite,
inquiryType: inquiry_type,
inquiryMessage: message
},
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment