Hello,
For quite some time I was using this script for HS enhanced conversions:
<script type="text/javascript">
window.addEventListener("message", function(event) {
if(event.data.type === 'hsFormCallback' && event.data.eventName === 'onFormSubmitted') {
window.dataLayer.push({
'event': 'hubspot_form_success',
'hs-form-guid': event.data.id,
'email': Object.keys(hubspot._emailValidationAndResubCache)[0]
});
}
});
</script>
Its one of the most popular enhanced conversions scripts out there - it was working like a charm up until last month, when all of the sudden script refused to work unless I deleted the
'email': Object.keys(hubspot._emailValidationAndResubCache)[0]
part (which is the one providing the enhanced conversion data.
Any way to get Enhanced Conversions back to Hubspot-based forms?