Hubspot forms
Certain Hubspot forms particularly those that are embedded in iframes are not compatible with Ruler's automatic form tracker and will require additional code to capture and report these conversions in your Ruler Report.
We have a Script you can implement on your website, to allow you to easily send data from these forms to Ruler Analytics without assistance from a Developer.
<script type="text/javascript">
window.addEventListener('message', (event) => {
if (
event.data.type === 'hsFormCallback' &&
event.data.eventName === 'onBeforeFormSubmit'
) {
var submission = event.data;
var payload = {
form_id: submission.id
};
for (let i = 0; i < submission.data.length; i++) {
var field = submission.data[i];
if (field.name && field.value && field.name !== "hs_context") {
payload[field.name] = field.value;
}
}
RulerAnalytics.trackConversionAsync(payload, "", "", 500);
}
});
</script>
This script can be applied to every page of your website, including pages that don't have a Hubspot form. (Footer/Header)
If you apply this script via Google Tag Manager it can be added as custom HTML and triggered on 'page load' or on 'DOM ready'.
Need help?
Email the Ruler support team: [email protected]
Updated 5 days ago