From 2f598478a242875488855496c058b21b08396056 Mon Sep 17 00:00:00 2001 From: Caleb Cox Date: Tue, 16 Apr 2024 14:07:31 -0500 Subject: [PATCH] Add success callback that exposes the form and its data --- public/campaign-form.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/campaign-form.js b/public/campaign-form.js index 64f4ee1..70c08ca 100644 --- a/public/campaign-form.js +++ b/public/campaign-form.js @@ -50,10 +50,11 @@ const postScriptLoad = function () { 'event': 'ga-email-signup' }) - // Call optional success callback if defined + // Call optional success callbacks if defined if (typeof campaignForm.successCallback === 'function') { window.campaignForm.successCallback(data.master_person_id) } + window.campaignForms.submittedCallback?.(form) // redirect if setup if (typeof data.redirect_url !== 'undefined') {