sandboxedScripts
למרות שלא מומלץ להגביל את סוגי התגים שמוטמעים באמצעות Google Tag Manager, יכול להיות שיהיה צורך להגביל את סוגי התגים שמוטמעים באתר מסיבות שונות. לדוגמה, יכול להיות שבעלי אתרים מסוימים לא ירצו שמשתמשי Google Tag Manager יוכלו להוסיף תגים מסוימים לאתר שלהם מסיבות שקשורות ליציבות הקוד או לאיסוף הנתונים. במסמך הזה מוסבר איך להגביל את הפריסה של תגים ב-Tag Manager.
כדי לקבוע אילו תגים, טריגרים ומשתנים מותרים בדף, משתמשים במפתחות gtm.allowlist או gtm.blocklist בשכבת הנתונים. המפתחות האלה יקבלו עדיפות על כל ההגדרות בקונטיינר. כשמוסיפים תגים, טריגרים ומשתנים לרשימת החסימה בצורה נכונה, הם לא מופעלים גם אם הם הוגדרו להפעלה ב-Google Tag Manager.
בדוגמה הבאה מוצג איך לאתחל את שכבת הנתונים עם רשימת היתרים וגם עם רשימת חסימה. שתי הרשימות הן אופציונליות, ואפשר להשתמש בהן בנפרד או ביחד (כמו שמוצג). שתי הרשימות צריכות להיות מסוג Array, והערכים ברשימה צריכים להיות מסוג String. צריך לדחוף את הערכים האלה אל שכבת הנתונים לפני הפעלת תגים כלשהם:
<script>
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'gtm.allowlist': ['<id>', '<id>', ...],
'gtm.blocklist': ['<id>', '<id>', '<id>', ...]
});
</script>
כל רכיב ID ברשימה מתאים לסוג ספציפי של תג, טריגר או משתנה, או לסוג של מחלקות. המחלקות מייצגות קבוצות של תגים, טריגרים ומשתנים עם אותן יכולות. לדוגמה, לכל התגים שיכולים לשלוח פיקסלים לדומיינים שאינם של Google יהיה הסיווג nonGooglePixels. השימוש במחלקות מועיל לחסימת יכולות בתגים, בטריגרים ובמשתנים הנוכחיים וגם בעתידיים.
חשוב להבין את הכללים שחלים על רשימות ההיתרים ורשימות החסימה:
- רשימות היתרים אם מוגדרת רשימת היתרים, תגים, טריגרים ומשתנים רלוונטיים יופעלו רק אם הם נכללים ברשימת ההיתרים, באופן מפורש (לפי מזהה סוג) או באופן משתמע (אם כל המחלקות שלהם נכללות ברשימה).
- רשימות חסימה אם מוגדרת רשימת חסימה, תגים, טריגרים ומשתנים יופעלו רק אם הם לא נמצאים ברשימת החסימה, באופן מפורש (לפי מזהה סוג) או באופן משתמע (אם אחד מהסיווגים שלהם נמצא ברשימה).
- רשימות חסימה מבטלות רשימות היתרים אם הגדרתם גם רשימת חסימה וגם רשימת היתרים, רשימת החסימה תקבל עדיפות. אפשר להשתמש ברשימת ההיתרים עבור סוג של תגים וברשימת החסימה עבור תג ספציפי באותו סוג, אבל אי אפשר לעשות את הפעולה ההפוכה. אי אפשר להשתמש ברשימת חסימה לסוג של תגים וברשימת היתרים לתג ספציפי באותו סוג.
- יש קשרים בין כיתות
יש כיתות שיש ביניהן קשרים. לדוגמה, תגים שיכולים להריץ סקריפטים שאינם של Google יכולים (בהגדרה) לשלוח פיקסלים שאינם של Google. לכן, חסימה של
nonGooglePixelsתוביל גם לחסימה אוטומטית שלnonGoogleScripts. כל התגים, הטריגרים והמשתנים ששייכים לאחת מהקבוצות ייחסמו.
בטבלה הבאה מפורטים התגים, הטריגרים והמשתנים הזמינים, הסוגים שלהם והמחלקות שאליהם הם שייכים:
| תג | ID |
Classes |
|---|---|---|
| AB TASTY Generic Tag | abtGeneric |
nonGoogleScripts |
| AdAdvisor Tag | ta |
nonGoogleScripts |
| Adometry Tag | adm |
google |
| AdRoll Smart Pixel Tag | asp |
nonGoogleScripts |
| תג מעקב המרות של Google Ads | awct |
google |
| תג רימרקטינג של Google Ads | sp |
google |
| תג ההמרה של Affiliate Window | awc |
nonGoogleScripts |
| Affiliate Window Journey Tag | awj |
nonGoogleScripts |
| Bing Ads Universal Event Tracking | baut |
nonGoogleScripts |
| Bizrate Insights Buyer Survey Solution | bb |
nonGoogleScripts |
| Bizrate Insights Site Abandonment Survey Solution | bsa |
nonGoogleScripts |
| תג מעקב רגיל של ClickTale (לא בשימוש) | cts |
nonGoogleScripts |
| comScore Unified Digital Measurement Tag | csm |
nonGoogleScripts |
| Conversant Mediaplex - תג IFRAME MCT | mpm |
nonGoogleIframes |
| Conversant Mediaplex - תג IMG ROI רגיל | mpr |
nonGooglePixels |
| Conversion Linker | gclidw |
google |
| תג Crazy Egg | cegg |
nonGoogleScripts |
| Criteo OneTag | crto |
nonGoogleScripts |
| תג HTML מותאם אישית | html |
customScripts |
| תג של תמונה מותאמת אישית | img |
customPixels |
| DistroScale Tag | dstag |
nonGoogleScripts |
| תג מונה של Floodlight | flc |
|
| תג מכירות של Floodlight | fls |
|
| Dstillery Universal Pixel Tag | m6d |
nonGooglePixels |
| תג Eulerian Analytics | ela |
customScripts |
| Google Tag (לשעבר 'הגדרה של Google Analytics') | gaawc |
google |
| אירוע ב-Google Analytics 4 | gaawe |
google |
| תג Google Analytics (מאמר שמתייחס לגרסה קודמת) | ga |
google |
| Google Consumer Surveys: שביעות רצון מהאתר | gcs |
google |
| תג Google Trusted Stores | ts |
|
| Hotjar Tracking Code | hjtc |
nonGoogleScripts |
| Infinity Call Tracking Tag | infinity |
nonGoogleScripts |
| Intent Media - Search Compare Ads | sca |
nonGoogleScripts |
| K50 tracking tag | k50Init |
nonGoogleScripts |
| LeadLab | ll |
nonGoogleScripts |
| LinkedIn Tag | bzi |
nonGoogleScripts |
| Lytics JS Tag | ljs |
nonGoogleScripts |
| Marin Software Tag | ms |
nonGoogleScripts |
| Mediaplex - תג IFRAME MCT | mpm |
nonGoogleIframes |
| Mediaplex – תג IMG ROI רגיל | mpr |
nonGooglePixels |
| Message Mate | messagemate |
nonGoogleScripts |
| Mouseflow Tag | mf |
nonGoogleScripts |
| Neustar Pixel | ta |
nonGoogleScripts |
| Nielsen DCR Static Lite Tag | ndcr |
nonGoogleScripts |
| תג ניתוח נתוני תוכן של Nudge | nudge |
nonGoogleScripts |
| Oktopost Tracking Code | okt |
nonGoogleScripts |
| Optimise Conversion Tag | omc |
nonGoogleScripts |
| OwnerListens Message Mate | messagemate |
nonGoogleScripts |
| Perfect Audience Pixel | pa |
nonGoogleScripts |
| Personali Canvas | pc |
nonGoogleScripts |
| פינטרסט | pntr |
nonGoogleScripts |
| Placed | placedPixel |
nonGoogleScripts |
| Pulse Insights Voice of Customer Platform | pijs |
nonGoogleScripts |
| Quantcast Audience Measurement | qcm |
nonGoogleScripts |
| Quora Pixel | qpx |
nonGoogleScripts |
| Rawsoft FoxMetrics | fxm |
nonGoogleScripts |
| SaleCycle JavaScript Tag | scjs |
customScripts |
| תג פיקסל (pixel tag) של SaleCycle | scp |
customPixels |
| מעקב JavaScript של SearchForce לדף המרות | sfc |
nonGoogleScripts |
| מעקב באמצעות JavaScript ב-SearchForce לדף נחיתה | sfl |
nonGoogleScripts |
| SearchForce Redirection Tracking Tag | sfr |
nonGooglePixels |
| Shareaholic | shareaholic |
nonGoogleScripts |
| Survicate Widget | svw |
nonGoogleScripts |
| Tradedoubler Lead Conversion Tag | tdlc |
nonGooglePixels |
| תג המרה למכירה ב-Tradedoubler | tdsc |
nonGooglePixels |
| הפעלת תג מעקב המרות | tc |
nonGoogleScripts |
| תג איסוף נתונים של Turn | tdc |
nonGoogleScripts |
| Twitter Universal Website Tag | twitter_website_tag |
nonGoogleScripts |
| תג כותרת תחתונה גלובלי של Upsellit | uslt |
customScripts |
| Upsellit Confirmation Tag | uspt |
customScripts |
| Ve Interactive JavaScript Tag | vei |
nonGoogleScripts |
| פיקסל Ve Interactive | veip |
nonGooglePixels |
| תג ההמרה VisualDNA | vdc |
nonGoogleScripts |
| Xtremepush | xpsh |
nonGoogleScripts |
| Yieldify | yieldify |
nonGoogleScripts |
| תחומים | zone |
|
| טריגר | ID |
Classes |
|---|---|---|
| Element Visibility Listener/Trigger | evl |
google |
| listener לקליקים/טריגר | cl |
google |
| listener/טריגר לשליחת טופס | fsl |
|
| History Listener/Trigger | hl |
google |
| JavaScript Error Listener/Trigger (מאזין/טריגר לשגיאות JavaScript) | jel |
google |
| Link Click Listener/Trigger (רכיב listener/טריגר של קליקים על קישורים) | lcl |
|
| listener/trigger למידת הגלילה בדף | sdl |
google |
| Timer Listener/Trigger | tl |
google |
| YouTube Video Listener/Trigger | ytl |
google |
| משתנה | ID |
Classes |
|---|---|---|
| קובץ Cookie מהדומיין הנוכחי | k |
google |
| משתנה של אירוע אוטומטי | v |
google |
| קבוע | c |
google |
| מספר גרסה של מאגר תגים | ctv |
google |
| אירוע מותאם אישית | e |
google |
| משתנה JavaScript בהתאמה אישית | jsm |
customScripts |
| משתנה שכבת נתונים | v |
google |
| מצב ניפוי באגים | dbg |
google |
| רכיב ה-DOM | d |
google |
| חשיפה של רכיבים | vis |
google |
| הגדרות ב-Google Analytics (גרסה קודמת) | gas |
google |
| גורם מפנה של HTTP | f |
google |
| משתנה JavaScript | j |
google |
| טבלת המיפוי | smm |
google |
| מספר אקראי | r |
google |
| טבלת ביטויים רגולריים (regex) | remm |
google |
| כתובת URL | u |
google |
בטבלה הבאה מפורטות הכיתות הזמינות והקשרים שלהן לכיתות אחרות. העמודה Allowlisted Automatically מייצגת את רשימת המחלקות שיתווספו לרשימת ההיתרים באופן מרומז, אם המחלקה מהשורה הזו גם היא תתווסף לרשימת ההיתרים. באופן דומה, העמודה Blocklisted Automatically מייצגת את רשימת הכיתות שייחסמו באופן מרומז כשהכיתה מהשורה הזו תיחסם.
| מחלקה | תיאור | ברשימת ההיתרים באופן אוטומטי | הוספה אוטומטית לרשימת החסימה |
|---|---|---|---|
customPixels |
אפשר לשלוח פיקסלים לכתובות URL שהוגדרו על ידי המשתמש. |
nonGooglePixels
|
customScriptshtml
|
customScripts |
יכול להריץ קוד JavaScript שסופק על ידי המשתמש. |
htmlcustomPixelsnonGooglePixelsnonGoogleScriptsnonGoogleIframes
|
html
|
google |
יכול להריץ רק סקריפטים שמתארחים ב-Google ולשלוח פיקסלים ל-Google. | ||
html |
כינוי של customScripts. הערה: זהו גם התג ID של תג ה-HTML בהתאמה אישית. כך אפשר לוודא שגם משתמשים בגרסאות קודמות
יקבלו את היתרונות של מחלקת customScripts. |
customScriptscustomPixelsnonGooglePixelsnonGoogleScriptsnonGoogleIframes
|
customScripts
|
nonGooglePixels |
אפשר לשלוח פיקסלים לדומיינים שאינם של Google. |
customPixelscustomScriptshtmlnonGoogleScriptsnonGoogleIframes
|
|
nonGoogleScripts |
יכול להריץ סקריפטים שלא סופקו על ידי Google. |
nonGooglePixels |
customScriptshtml
|
nonGoogleIframes |
יכול להחדיר iframes מדומיינים שאינם של Google. |
nonGooglePixels |
customScriptshtmlnonGoogleScripts
|
sandboxedScripts |
Sandboxed JavaScript שמשמש כחלק מתבניות בהתאמה אישית. | ללא | ללא |