Skip to content

Instantly share code, notes, and snippets.

@taf2
Created November 13, 2017 21:26
Show Gist options
  • Save taf2/0b5b0dc646dc3115774a9fcf5f7afbb5 to your computer and use it in GitHub Desktop.
Save taf2/0b5b0dc646dc3115774a9fcf5f7afbb5 to your computer and use it in GitHub Desktop.
Example FormReactor embed code
<!doctype html>
<html>
<head>
<style>
input[type=submit],
label { display:block; }
</style>
<!-- the tracing code typically using your tracking code found under Numbers -> Tracking Code -->
<script async src="//18614.ctmbizapp.co:8080/t.js"></script>
<title>FooBar Form Test Site</title>
</head>
<body>
<!-- the widget embed code -->
<iframe class="ctm-call-widget" src="https://app.ctmdev.us/form_reactors/FRT472ABB2C5B9B141AD0BD7258C47CE05FBE09EDCC399925CD" st
yle="width:100%;height:281px;border:none"></iframe>
<script defer async src="https://app.ctmdev.us/assets/form_reactors.js"></script>
<script>
window.__jctm_loaded = window.__jctm_loaded || [];
window.__jctm_loaded.push(function() {
// when a form is successfully filled out
__jctm(window).bind("ctm.form.success", function(evt, data) {
console.log(evt, data);
});
// when a user is rate limited e.g. they are trying to fill out the same form multiple times
__jctm(window).bind("ctm.form.limited", function(evt, data) {
console.log(evt, data);
});
// validation errors the user has validation issues filling out the form
__jctm(window).bind("ctm.form.error", function(evt, data) {
console.log(evt, data);
});
// failed - this is bad something unexpected happened
__jctm(window).bind("ctm.form.failed", function(evt, data) {
console.log(evt, data);
});
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment