Instapage
Track Instapage form submissions in Ruler Analytics
By adding a small script to your Instapage pages, you can track form submissions in Ruler.
This setup uses Instapage’s built-in form submit callback to capture form data at the time of submission and send it to Ruler.
In the example below, the script extracts the name, email address, and phone number from the form and passes them to Ruler. You can adjust this to capture different fields or update the selectors to match your specific form inputs.
<script>
window.instapageFormSubmitSuccess = function(form) {
if (!form) {
return;
}
var emailInput = form.querySelector('input[name="Email"]');
var emailValue = emailInput ? emailInput.value.trim() : "";
if (!emailValue) {
return;
}
var nameInput = form.querySelector('input[name="Name"]');
var nameValue = nameInput ? nameInput.value.trim() : "";
var phoneInput = form.querySelector('input[name="Phone"]');
var phoneValue = phoneInput ? phoneInput.value.trim() : "";
var rulerPayload = {
"email": emailValue
};
if (nameValue) {
rulerPayload.name = nameValue;
}
if (phoneValue) {
rulerPayload.phone = phoneValue;
}
if (typeof RulerAnalytics !== "undefined" && typeof RulerAnalytics.trackConversionAsync === "function") {
RulerAnalytics.trackConversionAsync(rulerPayload, "", "", 500);
}
};
</script>
The Instapage form submit callback can only be used once on each pageIf you have multiple scripts using the
window.instapageFormSubmiSuccess
callback you will need to link them together
Got a question?Speak to a member of the Ruler support team. Email [email protected]
Updated 1 day ago