واجهة برمجة تطبيقات إدارة العلامات - مرجع قاموس الماكرو

يصف هذا المستند الخصائص التي يمكن إعدادها لوحدات الماكرو في "إدارة العلامات من Google".

مقدمة

يحتوي كل ماكرو من "إدارة العلامات من Google" على رمز type لتحديد وحدة الماكرو. بالإضافة إلى ذلك، تحتوي معظم وحدات الماكرو على معلَمات (key، وأزواج type) يمكنك ضبطها كجزء من "كائن معلَمة" عند إنشاء وحدة ماكرو أو تعديلها. لمعرفة المزيد من المعلومات عن كيفية ضبط هذه المَعلمات باستخدام كائن مَعلمة، يُرجى الاطّلاع على مرجع المَعلمات.

يسرد بقية هذا المستند تفاصيل جميع وحدات الماكرو المتوافقة.

ملفات تعريف الارتباط الخاصة بالطرف الأول

رمز النوع

k

المَعلمات

المفتاح Type Notes
name template اسم ملف تعريف الارتباط.

مثال

 {
   "name": "Sample 1st Party Cookie Macro",
   "type": "k",
   "parameter": [
    {
     "type": "template",
     "key": "name",
     "value": "myCookieName"
    }
   ]
 }

متغيّر الحدث التلقائي

رمز النوع

aev

المَعلمات

المفتاح Type Notes
varType template واحد من ELEMENT أوCLASSES أو ID أو TARGET أو TEXT أو URL أو HISTORY_NEW_URL_FRAGMENT أو HISTORY_OLD_URL_FRAGMENT أو HISTORY_NEW_STATE أو HISTORY_OLD_STATE أو HISTORY_CHANGE_SOURCE.
defaultValue template اختياريّ.

مثال

  {
   "name": "Sample AutoEvent Variable",
   "type": "aev",
   "parameter": [
    {
     "type": "template",
     "key": "varType",
     "value": "CLASSES"
    },
    {
     "type": "template",
     "key": "defaultValue",
     "value": "MyDefault"
    }
   ]
  }

السلسلة الثابتة

رمز النوع

c

المَعلمات

المفتاح Type
value template

مثال

  {
   "name": "Sample Constant String",
   "type": "c",
   "parameter": [
    {
     "type": "template",
     "key": "value",
     "value": "MyString"
    }
   ]
  }

رقم إصدار الحاوية

رمز النوع

ctv

المَعلمات

لا ينطبق

مثال

  {
   "name": "Sample Container Version Number",
   "type": "ctv"
  }

الحدث المخصّص

رمز النوع

المَعلمات

لا ينطبق

مثال

  {
   "name": "Custom Event Name",
   "type": "e"
  }

محتوى JavaScript مخصّص

رمز النوع

jsm

المَعلمات

المفتاح Type
javascript template

مثال

  {
   "name": "Sample Custom Javascript",
   "type": "jsm",
   "parameter": [
    {
     "type": "template",
     "key": "javascript",
     "value": "function() {\n return \"Hello World\";\n}"
    }
   ]
  }

متغيّر طبقة البيانات

رمز النوع

v

المَعلمات

المفتاح Type Notes
name template اسم متغيّر طبقة البيانات
defaultValue template
dataLayerVersion integer 1 أو 2.

مثال

  {
   "name": "Sample Data Layer Variable",
   "type": "v",
   "parameter": [
    {
     "type": "template",
     "key": "name",
     "value": "DL Variable Name"
    },
    {
     "type": "template",
     "key": "defaultValue",
     "value": "DEFAULT"
    },
    {
     "type": "integer",
     "key": "dataLayerVersion",
     "value": "2"
    }
   ]
  }

وضع تصحيح الأخطاء

رمز النوع

dbg

المَعلمات

لا ينطبق

مثال

  {
   "name": "Sample Debug Mode Macro",
   "type": "dbg"
  }

عنصر DOM

رمز النوع

d

المَعلمات

المفتاح Type Notes
elementId template
attributeName template اختياريّ.

مثال

  {
   "name": "Sample DOM Element Macro",
   "type": "d",
   "parameter": [
    {
     "type": "template",
     "key": "elementId",
     "value": "MyElementId"
    },
    {
     "type": "template",
     "key": "attributeName",
     "value": "MyAttributeName"
    }
   ]
  }

مُحيل HTTP

رمز النوع

f

المَعلمات

المفتاح Type Notes
component template واحد من: URL, PROTOCOL, HOST, PORT, PATH, QUERY, FRAGMENT.
stripWww boolean بالنسبة إلى المكوِّن = HOST
queryKey template بالنسبة إلى المكوِّن = QUERY

مثال

  {
   "name": "Sample HTTP Referrer Macro",
   "type": "f",
   "parameter": [
    {
     "type": "template",
     "key": "component",
     "value": "URL"
    }
   ]
  }

متغيّر JavaScript

رمز النوع

j

المَعلمات

المفتاح Type Notes
name template اسم المتغيّر العمومي.

مثال

  {
   "name": "Sample Javascript Variable",
   "type": "j",
   "parameter": [
    {
     "type": "template",
     "key": "name",
     "value": "MyGlobalVarName"
    }
   ]
  }

جدول البحث

رمز النوع

smm

المَعلمات

المفتاح Type Notes
input template يجب أن تكون القيمة المستخدمة للبحث مرجعًا لوحدة الماكرو.
map list قائمة من الخرائط، ولكل منها زوج واحد من [key، value].
map[].key template
map[].value template
defaultValue template اختياريّ.

مثال

  {
   "name": "Sample Lookup Table Macro",
   "type": "smm",
   "parameter": [
    {
     "type": "template",
     "key": "input",
     "value": "{{event}}"
    },
    {
     "type": "list",
     "key": "map",
     "list": [
      {
       "type": "map",
       "map": [
        {
         "type": "template",
         "key": "key",
         "value": "EventEqualsThis"
        },
        {
         "type": "template",
         "key": "value",
         "value": "ThenSetToThis"
        }
       ]
      }
     ]
    },
    {
     "type": "template",
     "key": "defaultValue",
     "value": "MyDefaultValue"
    }
   ]
  }

رقم عشوائي

رمز النوع

r

المَعلمات

لا ينطبق

مثال

  {
   "name": "Sample Random Number Macro",
   "type": "r"
  }

URL

رمز النوع

u

المَعلمات

المفتاح Type Notes
component template واحد من: URL, PROTOCOL, HOST, PORT, PATH, QUERY, FRAGMENT.
customUrlSource template اختياريّ.
stripWww boolean بالنسبة إلى المكوِّن = HOST.
queryKey template بالنسبة إلى المكوِّن = QUERY.

مثال

  {
   "name": "Sample URL Macro",
   "type": "u",
   "parameter": [
    {
     "type": "template",
     "key": "component",
     "value": "URL"
    },
    {
     "type": "template",
     "key": "customUrlSource",
     "value": "{{element}}"
    }
   ]
  }