Variables: delete

يجب تقديم تفويض

يؤدي إلى حذف متغيّر GTM. جرِّبه الآن أو شاهد مثالاً.

الطلب

طلب HTTP

DELETE https://www.googleapis.com/tagmanager/v1/accounts/accountId/containers/containerId/variables/variableId

المَعلمات

اسم المعلَمة القيمة الوصف
مَعلمات المسار
accountId string رقم تعريف حساب "إدارة العلامات من Google".
containerId string رقم تعريف حاوية Google Tag Manager
variableId string رقم تعريف متغيّر GTM.

التفويض

يتطلب هذا الطلب تفويضًا من خلال النطاق التالي (مزيد من المعلومات حول المصادقة والترخيص).

النطاق
https://www.googleapis.com/auth/tagmanager.edit.containers

نص الطلب

لا توفِّر نص طلب بهذه الطريقة.

الإجابة

وفي حال نجاحها، تعرِض هذه الطريقة نص استجابة فارغًا.

أمثلة

ملاحظة: إنّ الأمثلة المرتبطة بالرموز والمتوفرة لهذه الطريقة لا تمثّل كل لغات البرمجة المتوافقة (يُرجى مراجعة صفحة مكتبات البرامج للاطّلاع على قائمة باللغات المتوافقة).

Java

تستخدم مكتبة عميل Java.

/*
 * Note: This code assumes you have an authorized tagmanager service object.
 */

/*
 * This request deletes an existing variable for the authorized user.
 */
try {
  tagmanager.accounts().
      containers().variables().delete("123456", "54321", "2").execute();
} catch (GoogleJsonResponseException e) {
  System.err.println("There was a service error: "
      + e.getDetails().getCode() + " : "
      + e.getDetails().getMessage());
}

Python

تستخدم مكتبة برامج Python.

# Note: This code assumes you have an authorized tagmanager service object.

# This request deletes an existing variable for the authorized user.
try:
  tagmanager.accounts().containers().variables().delete(
      accountId='123456',
      containerId='54321',
      variableId='3'
  ).execute()

except TypeError, error:
  # Handle errors in constructing a query.
  print 'There was an error in constructing your query : %s' % error

except HttpError, error:
  # Handle API errors.
  print ('There was an API error : %s : %s' %
         (error.resp.status, error.resp.reason))

تجربة

يمكنك استخدام مستكشف واجهات برمجة التطبيقات أدناه لطلب هذه الطريقة على البيانات المباشرة والاطّلاع على الاستجابة.