Skip to content

Commit

Permalink
Merge pull request hlxsites#1257 from hlxsites/1256-forms-datalayer
Browse files Browse the repository at this point in the history
Added datalayer event to submit
  • Loading branch information
davenichols-DHLS authored Aug 14, 2024
2 parents 1407b91 + 1c1c96b commit dcd4b72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion blocks/talk-to-an-expert-form/talk-to-an-expert-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ function getInquiry() {
const milli = String(currentDate.getUTCMilliseconds()).padStart(3, '0');
const inquiry = year + month + day + hour + min + sec + milli;
document.getElementsByName('Inquiry_Number')[0].value = inquiry;
document.getElementByName('TTAE').submit();
// eslint-disable-next-line
window.dataLayer?.push({ event: 'formSubmit', formId: 'TTAE', inquiry: inquiry });
}

function formValidate() {
Expand Down

0 comments on commit dcd4b72

Please sign in to comment.