Hi guys,
I’m currently using a few landingpages outside Unbounce but I’m trying to get this code working within Unbounce so we can also move these pages since the Unbounce builder is a way better way to work on these pages 🙂
We have this bit of code:
function clickout() {
window._fbq.push('track', 'InitiateCheckout');
var element = event.srcElement;
var fbc = getCookie("_fbc");
var fbp = getCookie("_fbp");
if (fbc == null || fbc == "") {
var urlParams = new URLSearchParams(window.location.search);
fbc = urlParams.get('fbclid');
}
element.href = element.href + "&afid=" + fbc + "&afid_2=" + fbp;
}
Is it possible to give a button on Unbounce the clickout function? We now use links and add this in the a href code at the end: onclick=“clickout();” and then it works. In Unbounce you can’t edit that source so how can I get this working?
Also will Unbounce allow the javascript to modify the URL and add the 2 extra values?
Thanks!