Chat with us, powered by LiveChat

คู่มือของคุณสำหรับการจัดการการชำระเงินทั่วโลก สำรวจแนวคิด เรื่องราว และไอเดียของเรา

We care about your data in our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Geometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shapeGeometric shape
View all
News
Product
Industry
Customer Stories
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Man working at desk

Blog 2

Linear helps streamline software projects, sprints, tasks, and bug tracking. Here’s how to get started.
Read post
Man pinning images on wall

Blog 3

The rise of RESTful APIs has been met by a rise in tools for creating, testing, and managing them.
Read post
Mountains

Blog 4

Mental models are simple expressions of complex processes or relationships.
Read post
Meeting

Blog 5

Introduction to Wireframing and its Principles. Learn from the best in the industry.
Read post
Meeting

Blog 5

JavaScript frameworks make development easy with extensive features and functionalities.
Read post

สมัครรับ newsletter

ลงทะเบียนเพื่อรับความรู้และข่าวสารล่าสุด
We care about your data in our privacy policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
(function () { // 1. 定义需要透传的参数白名单 const TRACKING_KEYS = ['inviteCode', 'utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term', 'gclid', 'fbclid', '_gl']; // 2. 获取当前页面的所有参数 const currentParams = new URLSearchParams(window.location.search); let passThroughString = ''; // 3. 拼接参数,确保每个参数前都有 '&' TRACKING_KEYS.forEach((key) => { if (currentParams.has(key)) { const val = encodeURIComponent(currentParams.get(key)); passThroughString += `&${key}=${val}`; // 注意这里:强制在每个参数前加 & } }); // 如果没有参数,直接结束,不执行后续逻辑 if (!passThroughString) return; // 4. 【暴力拦截】监听所有即将发生的跳转 // 这一步比点击事件更底层,只要浏览器想跳转,我们就能拦住 window.addEventListener( 'beforeunload', function (e) { // 获取当前鼠标点击的目标(如果是通过点击触发的跳转) // 注意:beforeunload 很难获取点击目标,所以我们改用捕获阶段的点击事件更稳妥 }, true, ); // 5. 【修正方案】使用捕获阶段的点击监听(比冒泡更早,更暴力) document.addEventListener( 'click', function (e) { // 找到被点击的链接 标签 let target = e.target; while (target && target !== document) { if (target.tagName === 'A' && target.href) { // 判断是否是我们要跳转的目标域名 if (target.href.includes('business.pingpongx.com')) { e.preventDefault(); // 阻止默认跳转 // --- 开始组装新链接 --- const url = new URL(target.href); // 1. 强制设置 location=in url.searchParams.set('location', 'in'); // 2. 把我们提取到的参数一个个塞进去(自动处理 & 分隔符) TRACKING_KEYS.forEach((key) => { if (currentParams.has(key)) { url.searchParams.set(key, currentParams.get(key)); } }); // 3. 执行跳转 window.location.href = url.toString(); return; // 处理完就退出 } } target = target.parentNode; } }, true, // true 表示在“捕获阶段”监听,比页面原有的任何事件都优先 ); })();