התראה

The Google Analytics: GA4 Configuration tag is now the Google tag. GA4 Configuration tags in a web container will be automatically migrated starting in September. There are no changes to your existing measurement and there is no action required from you. Learn more

הגדרה של תהליך לקבלת הסכמה מהמשתמשים ב-TrustArc

כדי לקבל תובנות חשובות על המשתמשים באתר בלי לפגוע בפרטיות שלהם, צריך לקבל את הסכמתם. כדי לקבל הסכמה ולשלוח אותה ל-Google, מומלץ להשתמש בפלטפורמת ניהול הסכמה (CMP) או במערכת ניהול התוכן (CMS) שלכם.

שלב 1: הגדרת באנר בקשת ההסכמה

  1. אם אתם משתמשים בגרסה CCM Advanced (שירות מנוהל), מנהל החשבונות הטכני (TAM) יגדיר את הבאנר בהתאם להנחיות הסגנון ולדרישות שלכם.
  2. אם אתם משתמשים בגרסה CCM Pro (פלטפורמת CMP בשירות עצמי), מערכת TrustArc תספק לכם את כתובת ה-URL לכניסה לפורטל ולהגדרת הבאנר באמצעות התבניות המוגדרות מראש באשף.
  3. מוודאים שהבאנר עומד בדרישות של מדיניות Google בנושא הסכמת משתמשים באיחוד האירופי (EUUCP). פרטים נוספים על הגדרת הבאנר של TrustArc זמינים בקטע Getting Started (תחילת העבודה) במדריך למשתמש.
  4. מוסיפים לקוד האתר את רכיבי <div> שאחראים לעיבוד הבאנר והקישור ל-CMP, או משתמשים ב-Google Tag Manager.

שלב 2: הגדרת סטטוס ההסכמה

שימוש ב-Google Tag Manager

  1. פותחים את Tag Manager ועוברים למאגר התגים.
  2. בקטע Tags (תגים), לוחצים על New (חדש) ונותנים שם לתג.
  3. לוחצים על Tag Configuration (הגדרת התג) ואז על Discover more tag types in the Community Template Gallery (סוגי תגים נוספים בגלריית התבניות של הקהילה). בגלריה, מחפשים את התבנית TrustArc CMP (Consent Mode) ומתקינים אותה.
  4. בקטע Default Consent Mode settings (הגדרות ברירת מחדל של סטטוס הסכמה), קובעים את הגדרות ברירת המחדל שבהן רוצים להשתמש.
  5. בוחרים באפשרות Deploy CMP Script using the template (פריסת הסקריפט של ה-CMP באמצעות התבנית).
    1. בשדה CMP ID (מזהה ה-CMP), מזינים את מזהה המופע שמופיע בשלב 4. מעתיקים את קטע הקוד של פורטל CCM Pro. אם אתם משתמשים בגרסה CCM Advanced, מנהל החשבון הטכני יכול לספק לכם את המידע הזה.
    2. בשדה Additional parameters (פרמטרים נוספים), מזינים הגדרות נוספות למופע. ההגדרות האלה מקבלות עדיפות על פני ההגדרות בקצה העורפי כמו שפה, זיהוי לפי מיקום גיאוגרפי, קישורים למדיניות הפרטיות וכו'.
  6. כדי להגדיר שילוב עם סטטוס ההסכמה של Google, מפעילים את האפשרות Integrate CMP with Google Consent Mode (שילוב ה-CMP עם סטטוס ההסכמה של Google).
  7. מעדכנים את המיפוי של סוגי ההסכמה ושל העדפות המשתמש בהתאם להגדרות שקבעתם. צריך למפות כל סוג הסכמה שבו אתם משתמשים לפי המזהה המתאים של קטגוריית ההסכמה לשימוש בקובצי Cookie‏ (Required [חובה] Functional [פונקציונלית] Advertising [פרסום]). בשדה Preferences Cookie (קובץ Cookie להעדפות), ממפים קובץ Cookie מהדומיין הנוכחי ל-cmapi_cookie_privacy. בשדה Behavior Cookie (קובץ Cookie להתנהגות), ממפים קובץ Cookie מהדומיין הנוכחי ל-notice_behavior.
  8. לוחצים על Triggering > Consent Initialization - All Pages > Save ('טריגרים' > 'הפעלת הגדרות הסכמה – כל הדפים' > 'שמירה').
  9. כדי לבדוק את מאגר התגים, לוחצים על Preview (תצוגה מקדימה) בפינה הימנית העליונה (הוראות הבדיקה מפורטות בהמשך).
  10. מפרסמים את מאגר התגים.

שימוש בפלטפורמות אחרות או עריכה ישירה של קוד האתר 

  1. מתחברים אל פורטל התמיכה של TrustArc, פותחים את המדריך של TrustArc להטמעת סטטוס ההסכמה של Google דרך הקישור הזה ופועלים לפי ההוראות בקטע Integrating the Consent Mode Using JavaScript (שילוב סטטוס ההסכמה באמצעות 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!-->

האם המידע הועיל?

איך נוכל לשפר את המאמר?
true
חיפוש
ניקוי החיפוש
סגירת החיפוש
התפריט הראשי
9562473096220172389
true
חיפוש במרכז העזרה
true
true
true
true
true
102259
false
false