Skip to content

Commit

Permalink
Contact form drift code issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-bluetext committed Aug 8, 2024
1 parent 2e187b7 commit 178e0ac
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions blocks/marketo-2/marketo-2.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,14 @@ const embedMarketoForm = (marketoId, formId, successUrl) => {
window.MktoForms2.loadForm('//go.merative.com', `${marketoId}`, formId, (form) => {
// Add an onSuccess handler
form.onSuccess((values) => {
console.log('Form submitted successfully');
// console.log('Form submitted successfully');
if (typeof drift !== 'undefined') {
console.log('in');
drift.on('ready', (api) => {
try {
console.log('in2');
api.commitFormData({
campaignId: 2787244,
});
if (location.href.includes('/contact')) {
console.log('in3');
// Drift popup custom code
api.collectFormData(values, {
campaignId: 2787244,
Expand All @@ -59,15 +56,6 @@ const embedMarketoForm = (marketoId, formId, successUrl) => {
} else {
console.info('Drift is not defined');

Check warning on line 57 in blocks/marketo-2/marketo-2.js

View workflow job for this annotation

GitHub Actions / build

Unexpected console statement
}
// Adobe Launch tracking for form submission
// if (window._satellite) {
// _satellite.track('formSubmit', {
// formName: document.title,
// });
// }

// Redirect to the success URL
// location.href = successUrl;
// Return false to prevent the submission handler continuing with its own processing
return false;
});
Expand Down

0 comments on commit 178e0ac

Please sign in to comment.