var loc = window.location.pathname; if(loc.includes("thank-you")) {​ fbq('track', 'Lead'); }