เอกสารนี้มีไว้สําหรับผู้ใช้ที่ต้องการติดตั้งใช้งานแท็ก Google ในโหมดบุคคลที่หนึ่ง เราขอแนะนําให้ใช้โหมดบุคคลที่หนึ่งสําหรับการกําหนดค่าแท็กที่คงทนที่สุด
ภาพรวม
โหมดบุคคลที่หนึ่งช่วยให้คุณติดตั้งใช้งานแท็ก Google โดยใช้โครงสร้างพื้นฐานของบุคคลที่หนึ่งของคุณเองซึ่งโฮสต์ในโดเมนของเว็บไซต์ โครงสร้างพื้นฐานนี้อยู่ตรงกลางระหว่างเว็บไซต์ของคุณกับบริการของ Google การตั้งค่าในเอกสารประกอบนี้จะช่วยให้คุณวัดผลเว็บไซต์ได้ดียิ่งขึ้น คุณตั้งค่าได้โดยใช้เครือข่ายนำส่งข้อมูล (CDN), ตัวจัดสรรภาระงาน หรือเว็บเซิร์ฟเวอร์ที่มีอยู่
ในการตั้งค่าแท็ก Google มาตรฐาน หน้าเว็บจะขอแท็ก Google จากโดเมน Google เมื่อแท็กเริ่มทํางาน ก็จะส่งคําขอการวัดไปยังผลิตภัณฑ์ Google โดยตรง ในโหมดบุคคลที่หนึ่ง เว็บไซต์จะโหลดแท็ก Google จากโดเมนบุคคลที่หนึ่ง เมื่อแท็กเริ่มทํางาน แท็กจะส่งคําขอการวัดไปยังโดเมนของบุคคลที่หนึ่ง ซึ่งจะส่งต่อไปยังผลิตภัณฑ์ที่เกี่ยวข้องของ Google
[null,null,["อัปเดตล่าสุด 2025-02-24 UTC"],[[["This guide provides instructions for deploying the Google tag in first-party mode, offering a more durable and potentially better-performing tag configuration."],["First-party mode involves hosting the Google tag on your own domain, mediating data flow between your website and Google services."],["Your existing CDN or load balancer can be used to forward requests, and the guide assumes you already have a Google tag or Tag Manager container setup."],["Two setup options are available: manual setup or automated setup using Cloudflare."],["Testing involves verifying that event hits are correctly routed through your domain using Tag Assistant."]]],["First-party mode deploys the Google tag using your website's domain, enhancing measurement. It involves using your existing CDN, load balancer, or web server to host the tag. Instead of loading the tag from a Google domain, the website loads it from your domain, and measurement requests are routed through your domain before reaching Google. To set it up, choose either manual or automated setup (Cloudflare). To test, use Tag Assistant to preview your container and verify hits are routed correctly to `/metrics`.\n"]]