"
"
Intro Video | Subscribe 2Ride
top of page
bottom of page
document.addEventListener("DOMContentLoaded", function() {
document.querySelectorAll("button, a, div").forEach(function(el) {
if (el.innerText && el.innerText.trim() === "Subscribe") {
el.addEventListener("click", function() {
fbq('track', 'Subscribe');
});
}
});
});
// Fire 'Lead' when any visible element with text "Contact" is clicked.
(function () {
function whenFbqReady(cb, attempts = 0) {
if (typeof window.fbq === "function") return cb();
if (attempts > 50) return;
setTimeout(() => whenFbqReady(cb, attempts + 1), 100);
}
function textIsContact(el) {
if (!el || !el.innerText) return false;
return el.innerText.trim().toLowerCase() === "contact";
}
function bindClicks(root = document) {
const candidates = root.querySelectorAll("button, a, div, span");
candidates.forEach((el) => {
if (textIsContact(el) && !el.dataset.fbqLeadBound) {
el.dataset.fbqLeadBound = "1";
el.addEventListener("click", () => {
if (typeof window.fbq === "function") {
try { window.fbq("track", "Lead"); } catch (e) {}
}
});
}
});
}
function observeMutations() {
const mo = new Mutation