การแจ้งเตือน

Google Analytics: ตอนนี้แท็กการกําหนดค่า GA4 เปลี่ยนเป็นแท็ก Google แล้ว ระบบจะย้ายข้อมูลแท็กการกําหนดค่า GA4 ในคอนเทนเนอร์ฝั่งเว็บโดยอัตโนมัติตั้งแต่เดือนกันยายน จะไม่มีการเปลี่ยนแปลงในการวัดผลที่มีอยู่ และคุณไม่จำเป็นต้องดำเนินการใดๆ ดูข้อมูลเพิ่มเติม

ตั้งค่า TrustArc เพื่อขอรับความยินยอมจากผู้ใช้

หากต้องการบันทึกข้อมูลเชิงลึกที่มีประโยชน์ไปพร้อมกับปกป้องความเป็นส่วนตัวของผู้ใช้ คุณต้องรวบรวมความยินยอมจากผู้ใช้เว็บไซต์ เราขอแนะนำให้ใช้แพลตฟอร์มการจัดการความยินยอม (CMP) หรือทำงานร่วมกับระบบจัดการเนื้อหา (CMS) เพื่อรวบรวมความยินยอมและส่งไปยัง Google

ขั้นตอนที่ 1: ตั้งค่าแบนเนอร์แสดงความยินยอมให้ใช้คุกกี้ทางการตลาด

  1. หากคุณมี CCM Advanced (บริการที่มีการจัดการ) ผู้จัดการลูกค้าด้านเทคนิค (TAM) จะตั้งค่าแบนเนอร์ตามข้อกำหนดและหลักเกณฑ์เกี่ยวกับรูปแบบของคุณ
  2. หากคุณมี CCM Pro (Self-Service CMP) TrustArc จะให้ URL แก่คุณเพื่อให้ลงชื่อเข้าใช้พอร์ทัลและกำหนดค่าแบนเนอร์โดยใช้เทมเพลตที่กำหนดไว้ล่วงหน้าในวิซาร์ด
  3. ตรวจสอบว่าแบนเนอร์เป็นไปตามข้อกำหนดในนโยบายความยินยอมของผู้ใช้ EU (EUUCP) ของ Google สำหรับรายละเอียดเพิ่มเติมเกี่ยวกับการตั้งค่าแบนเนอร์ TrustArc โปรดดูส่วนการเริ่มต้นใช้งานในคู่มือผู้ใช้ของเรา
  4. ใส่องค์ประกอบ <div> ซึ่งมีหน้าที่แสดงผลแบนเนอร์และลิงก์ CMP ในโค้ดของเว็บไซต์หรือผ่าน Google Tag Manager

ขั้นตอนที่ 2: ตั้งค่าโหมดความยินยอม

การใช้ Google Tag Manager

  1. เปิด Tag Manager และไปที่คอนเทนเนอร์ของคุณ
  2. ใน "แท็ก" ให้คลิก "ใหม่" แล้วตั้งชื่อแท็ก
  3. คลิกการกำหนดค่าแท็ก แล้วคลิกค้นหาประเภทแท็กเพิ่มเติมในแกลเลอรีเทมเพลตชุมชน จากแกลเลอรี ให้ค้นหา "TrustArc CMP (โหมดความยินยอม)" แล้วติดตั้ง "TrustArc CMP (โหมดความยินยอม)" โดย TrustArc
  4. กําหนดการตั้งค่าเริ่มต้นที่ต้องการใช้ในส่วน "การตั้งค่าโหมดความยินยอมเริ่มต้น"
  5. เลือกตัวเลือกทำให้สคริปต์ CMP ใช้งานได้โดยใช้เทมเพลต
    1. ในช่องรหัส CMP ให้ป้อนรหัสอินสแตนซ์ที่มีในขั้นตอนที่ 4 คัดลอกข้อมูลโค้ดของพอร์ทัล CCM Pro หากคุณมี CCM Advanced ผู้จัดการลูกค้าด้านเทคนิค (TAM) สามารถให้ข้อมูลนั้นแก่คุณได้
    2. ในช่องพารามิเตอร์เพิ่มเติม ให้ป้อนการตั้งค่าเพิ่มเติมสำหรับอินสแตนซ์ ใช้การกำหนดค่านี้ใช้เพื่อลบล้างการกำหนดค่าแบ็กเอนด์ เช่น ภาษา การตรวจจับทางภูมิศาสตร์ ลิงก์นโยบายความเป็นส่วนตัว ฯลฯ
  6. ตั้งค่าการผสานรวมโหมดความยินยอมของ Google โดยเปิดใช้ตัวเลือกผสานรวม CMP กับโหมดความยินยอมของ Google
  7. ระบุการแมปประเภทความยินยอมและค่ากำหนดของผู้ใช้ตามการตั้งค่าของคุณ สําหรับความยินยอมแต่ละประเภทที่คุณใช้อยู่ ให้แมปกับรหัสที่ตรงกันของที่เก็บข้อมูลความยินยอมในการใช้คุกกี้ (ต้องระบุ การใช้งาน การโฆษณา) ในช่องคุกกี้ค่ากำหนด ให้แมปคุกกี้ของบุคคลที่หนึ่งสำหรับ cmapi_cookie_privacy ในช่องคุกกี้พฤติกรรม ให้แมปคุกกี้ของบุคคลที่หนึ่งสำหรับ notice_behavior
  8. คลิกการทริกเกอร์ > การเริ่มต้นขอความยินยอม - ทุกหน้า > บันทึก
  9. ทดสอบคอนเทนเนอร์โดยคลิกแสดงตัวอย่างที่มุมขวาบน (ดูวิธีการทดสอบด้านล่าง)
  10. นำคอนเทนเนอร์ไปใช้จริง

การใช้แพลตฟอร์มอื่นๆ หรือการแก้ไขโค้ดของเว็บไซต์โดยตรง 

  1. ลงชื่อเข้าใช้พอร์ทัลการสนับสนุน TrustArc เปิดคู่มือการใช้งานโหมดความยินยอมของ Google TrustArc จากลิงก์นี้ จากนั้นทำตามวิธีการในส่วนการผสานรวมโหมดความยินยอมโดยใช้ JavaScript​​
  2. หากคุณใช้เครื่องมือสร้างเว็บไซต์ โปรดอ่านเอกสารเกี่ยวกับวิธีติดตั้งโค้ดในแท็ก head ของแต่ละหน้า ไม่เช่นนั้น ให้ข้ามไปยังขั้นตอนที่ 3
  3. หากคุณใช้เวอร์ชัน CCM Advanced โปรดทำตามขั้นตอนนี้ ไม่เช่นนั้น ให้ข้ามไปยังขั้นตอนที่ 4 ในแท็ก head ของแต่ละหน้า (ดูขั้นตอนที่ 2 หากคุณใช้เครื่องมือสร้างเว็บไซต์) ให้คัดลอกและวางโค้ดด้านล่างนี้ ตามด้วยสคริปต์ CMP ที่คุณคัดลอกในขั้นตอนที่ 1 ที่ด้านบนสุดของแท็ก head โปรดทราบว่าขั้นตอนนี้เป็นขั้นตอนสําคัญเพื่อให้ CMP ทํางานได้อย่างถูกต้อง

    <script>

    window.dataLayer = window.dataLayer || [];

    function gtag(){dataLayer.push(arguments);}

     

    gtag('js', new Date());

    gtag('config', 'AW-YYYYYY');

     

    // Default consent types to 'denied' as a placeholder

    // Determine actual values based on your own requirements

    // Please omit consent types not being used

    gtag('consent', 'default', {

    'ad_storage': 'denied',

    'ad_user_data': 'denied',

    'ad_personalization': 'denied',

    'analytics_storage': 'denied',

    'functionality_storage': 'denied',

    'personalization_storage': 'denied',

    'security_storage': 'denied',

    'wait_for_update': 500

    });

    gtag('set', 'ads_data_redaction', true);

    gtag('set', 'developer_id.dNTIxZG', true);

    </script>

    <!--Banner script here!-->

  4. หากคุณใช้เวอร์ชัน CCM Pro โปรดทำตามขั้นตอนนี้ ในแท็ก head ของแต่ละหน้า (ดูขั้นตอนที่ 2 หากคุณใช้เครื่องมือสร้างเว็บไซต์) ให้คัดลอกและวางโค้ดด้านล่างนี้ ตามด้วยสคริปต์ CMP ที่คุณคัดลอกในขั้นตอนที่ 1 ที่ด้านบนสุดของแท็ก head โปรดทราบว่าขั้นตอนนี้เป็นขั้นตอนสําคัญเพื่อให้ CMP ทํางานได้อย่างถูกต้อง โปรดปรับการเชื่อมโยงระหว่างที่เก็บข้อมูล CMP กับประเภทความยินยอม

    window.dataLayer = window.dataLayer || [];

    function gtag() { dataLayer.push(arguments); }

    gtag('js', new Date());

    gtag('config', 'GA_MEASUREMENT_ID');

    gtag('set', 'developer_id.dNTIxZG', true);

    // TODO: Can be changed according to customer's need and according to the configuration

    gtag('set', 'ads_data_redaction', true);

    gtag('set', 'url_passthrough', true);

    //Consent Mode Status

    const ConsentType = {

    DENIED: 'denied',

    GRANTED: 'granted',

    };

     

    const convertBooleanToGrantedOrDenied = (boolean) => boolean ? ConsentType.GRANTED : ConsentType.DENIED;

     

    /*

    TODO: This is where you can configure the Google Consent Mode, map the CMP categorisation and the default values for the consent initialization

    Google recommends commenting our consent types that you are not going to use.

    */

    const domain = 'your_domain.com'; // TODO: update

    // Bucket Mapping

    const REQUIRED = 1;

    const FUNCTIONAL = 2;

    const ADVERTISING = 3;

    const consentTypesMapped = {

    'ad_storage': ADVERTISING,

    'ad_user_data': ADVERTISING,

    'ad_personalization': FUNCTIONAL,

    'analytics_storage': FUNCTIONAL,

    'functionality_storage': FUNCTIONAL,

    'personalization_storage': FUNCTIONAL,

    'security_storage': REQUIRED

    }

    const getConsentState = (prefCookie) => {

    var consentStates = {};

    var noticeBehavior = window.truste.util.readCookie("notice_behavior");

    /*

    TODO: Can be changed according to customer's need and according to the configuration

    */

    var impliedLocation = noticeBehavior && noticeBehavior.includes("na");

    for (const consentType in consentTypesMapped) {

    var id = consentTypesMapped[consentType];

     

    if(prefCookie && !prefCookie.includes(0)) {

    console.log("Existing consent..");

    consentStates[consentType] = convertBooleanToGrantedOrDenied(prefCookie && prefCookie.includes(id));

    } else {

    console.log("Non Existing consent..");

    consentStates[consentType] = convertBooleanToGrantedOrDenied(impliedLocation);

    ;}

    ;}

    consentStates['wait_for_update'] = 500;

    console.log(consentStates);

    return consentStates;

    };

    /*

    Helper function to submit a GCM event based on user's preferences on TrustArc's Script

    consent: The consent object will be an array of values [1, 2, 3, n] as 1 being if the user consented to required, 2 to function, ... etc

    This function needs to be customized according to the customer's needed mapping. Ex: 'ad_storage': returnGrantedOrDenied(advertisingAccepted) is being mapped to advertising. if we were to map it to functional instead, we just need to change the bucket variable it's looking at. 

    */

     

    var runOnceGCM = 0;

    function handleConsentDecisionForGCM(consent) {

    //This code initializes the consent mode

    const consentStates = getConsentState(consent.consentDecision);

    var defaultOrUpdate;

    if (runOnceGCM == 0) {

    defaultOrUpdate = 'default';

    runOnceGCM++;

    } else {

    console.log('consent is being updated');

    defaultOrUpdate = 'update';

    }

    console.log(consentStates);

    //Once consent is changed, we will send an update 

    gtag('consent', defaultOrUpdate, {

    consentStates

    });

    }

     

    // This code is responsible for listening to any consent changes trough TrustArc's CCM Instance

    // And pushing the consent changes to the dataLayer according to the customer's consent mapping

    // This is for the intial load. If the user has a consent different from the default values, this is to push an update to the datalayer 

    // Once the CCM loads. 

    var interval = setInterval(() => {

    if (window.truste) {

    var consentDecision = truste.cma.callApi("getGDPRConsentDecision", domain);

    handleConsentDecisionForGCM(consentDecision);

    clearInterval(interval);

    console.log("running once...");

    }

    }, 100);

     

    // Start listening to when users submit their preferences  

    window.addEventListener("message", (event) => {

    let eventDataJson = null;

    // We only care about TrustArc Events at this point. And TrustArc's even it encoded in JSON

    try {

    eventDataJson = JSON.parse(event.data);

    } catch {

    // Some other event that is not JSON. 

    // TrustArc encodes the data as JSON

    // console.log(event.data);

    }

     

    // Safeguard to make sure we are only getting events from TrustArc

    if (eventDataJson && eventDataJson.source === "preference_manager") {

    // Means that the user has submited their preferences

    if (eventDataJson.message === "submit_preferences") {

    console.log("Event Data: ", eventDataJson);

    // Waiting half a second to make sure user's preferences are reflected. 

    setTimeout(() => {

    var consentDecision = truste.cma.callApi("getGDPRConsentDecision", domain);

    console.log("Consent Decision: ", consentDecision);

    handleConsentDecisionForGCM(consentDecision);

    }, 500);

    }

    }

    }, false);

    <!--Banner script here!-->

การทดสอบโดยใช้ผู้ช่วยแท็ก

ดูวิธีแก้ปัญหาเกี่ยวกับโหมดความยินยอมด้วย Google Tag Manager

ข้อมูลนี้มีประโยชน์ไหม

เราจะปรับปรุงได้อย่างไร
true
ค้นหา
ล้างการค้นหา
ปิดการค้นหา
เมนูหลัก
6712136527266808668
true
ค้นหาศูนย์ช่วยเหลือ
true
true
true
true
true
102259
false
false