cookiewow-logo
หน้าหลักคู่มือการใช้งานคำถามที่พบบ่อย (FAQs)การอัปเดตเป็น Google Consent V2

การอัปเดตเป็น Google Consent V2

หมวดหมู่:คำถามที่พบบ่อย (FAQs)อัปเดตเมื่อ: 23/09/2026

บทความนี้จะช่วยแนะนำวิธีการอัปเดตการตั้งค่า Google Consent ไปเป็นเวอร์ชัน 2 คุณสามารถดูข้อมูลอย่างเป็นทางการได้จาก ที่นี่

  1. ตรวจสอบ **** tag ในปัจจุบันของคุณที่ใช้งานร่วมกับ Google Tag หรือ Google Analyticsตัวอย่าง (ก่อนอัปเดต):

<script async src="<https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX>"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() { dataLayer.push(arguments); }
  gtag('js', new Date());
  gtag('consent', 'default', {
    'ad_storage': 'denied',
    'analytics_storage': 'denied'
  });
  gtag('config', 'G-XXXXXXXXXX');
</script>

ส่วนที่สำคัญคือ:

gtag('consent', 'default', {
    'ad_storage': 'denied',
    'analytics_storage': 'denied'
  });

เพราะสำหรับ Google Consent V2 ต้องมีการเพิ่มค่าความยินยอมเพิ่มเติม

  1. เพิ่มข้อมูลการขอความยินยอมเพิ่มเติมดังนี้ (โค้ดหลังอัปเดต):

gtag('consent', 'default', {
  'ad_storage': 'denied',
  'ad_user_data': 'denied',
  'ad_personalization': 'denied',
  'analytics_storage': 'denied'
});

บรรทัดนี้คือส่วนที่เพิ่มเข้ามา:

'ad_user_data': 'denied',
  'ad_personalization': 'denied'
คุณยังต้องเพิ่มสิ่งเหล่านี้ที่
<script>
  function consentGrantedAdStorage() {
    gtag('consent', 'update', {
      'ad_user_data': 'granted'
    });
    gtag('consent', 'update', {
      'ad_personalization': 'granted'
    });
  }
</script>

นี่คือเวอร์ชันสุดท้ายของสคริปต์ที่ใช้งานร่วมกับ Cookie Wow:

<script>
  window.dataLayer = window.dataLayer || [];
  function gtag() {
    window.dataLayer.push(arguments);
  }

  // Initialize Google Analytics with default consent settings
  gtag('js', new Date());

  gtag('consent', 'default', {
    'ad_storage': 'denied',
    'analytics_storage': 'denied',
    'ad_user_data': 'denied',

 'ad_personalization': 'denied',
  });

  // Define wrapper to update consent if user accepts

 function cwcCookieWrapper() {
    if (window.cwcIsUserAccept && window.cwcIsUserAccept('analytics')) {
      gtag('consent', 'update', {
        'analytics_storage': 'granted'
      });
    }

    if (window.cwcIsUserAccept && window.cwcIsUserAccept('marketing')) {
      gtag('consent', 'update', {
        'ad_storage': 'granted',
        'ad_user_data': 'granted',
        'ad_personalization': 'granted'
      });
    }
  }
</script>

ตอนนี้คุณสามารถทดสอบการตั้งค่าได้เลย

บทความที่เกี่ยวข้อง

ดูทั้งหมด

วิธีชำระค่าบริการ

Cookie Wow ให้บริการเป็นแบบ Subscription หมายถึงการสมัครสมาชิกแบบรายเดือน หรือรายปีแบบต่อเนื่องหากคุณชำระเงินด้วยบัตรเครดิต ระบบจะทำการต่...

Cookie Wow รองรับการจัดการ Consent ในแอปพลิเคชั่น iOS หรือ Android หรือไม่

Cookie Wow รองรับการสร้างแบนเนอร์คุกกี้เพื่อใช้งานบนเว็บไซต์เท่านั้น โดยแบนเนอร์คุกกี้ที่แสดงจะรองรับการแสดงผลทั้งบนหน้าจอคอมพิวเตอร์ แท็...

การหัก ณ ที่จ่ายของ Data Wow ทำไมไม่เหมือนหน้าเว็บไซต์

ในส่วนของการหัก ณ ที่จ่าย ของ Cookie Wow ขออนุญาตชี้แจงดังนี้สำหรับการชำระค่าบริการผ่านการตัดบัตรเครดิตเนื่องจากเป็นจากผูกบัตรเครดิตไว้กั...

ให้เราช่วยเหลือเพิ่มเติม?

ติดต่อเราเพื่อให้เราช่วยแก้ปัญหาให้คุณ

แชทกับเราส่งอีเมลหาเรา