Created
September 14, 2023 08:38
-
-
Save luongngocminh/ba583ca53a8697193b5c1f11331bcd82 to your computer and use it in GitHub Desktop.
Hijack Engagebay form redirection to add external params like UTM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Hijacking Engagebay HTML form submission redirection | |
// By: Luong Ngoc Minh | |
// Usage: Replace the original form submit function | |
function onSubmit(e, t) { | |
e.preventDefault(); | |
window.EhForm.redirect_to_url = function(a, f, i, b) { | |
var g = f; | |
try { | |
g = JSON.parse(f); | |
} catch (h) { | |
console.log(h); | |
} | |
var j = { | |
subscriber_data: JSON.stringify(g), | |
}; | |
var c = a; | |
c = eh_mustache_fill_Subscriber_Data(g, c); | |
if (i) { | |
c = EhSync.prepareURL(c, j); | |
} | |
var d = window.open(c + document.location.search, b ? "_blank" : "_self"); | |
d.location; | |
}; | |
window.EhForm.submit_form(e, t); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment