document.addEventListener("DOMContentLoaded", function () {
// 监听所有 a 标签点击事件
document.body.addEventListener("click", function (event) {
let target = event.target.closest("a");
// 检查是否为 PPC 广告
if (target && target.href.includes("googleadservices.com")) {
console.log("PPC 竞价广告点击:", target.href);
// 触发 Facebook Pixel 事件(Lead)
fbq('track', 'Lead', {
content_name: "Google PPC Ad Click",
content_category: "Google Ads",
value: 0.01,
currency: "USD"
});
} else {
console.log("非 PPC 广告点击,忽略");
}
});
});