Skip to content

Commit

Permalink
Add success callback that exposes the form and its data
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Apr 16, 2024
1 parent a686ebe commit 2f59847
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/campaign-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down

0 comments on commit 2f59847

Please sign in to comment.