ต้องมีการให้สิทธิ์
ลบกลุ่มเป้าหมายรีมาร์เก็ตติ้ง ดูตัวอย่าง
ส่งคำขอ
คำขอ HTTP
DELETE https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId
พารามิเตอร์
ชื่อพารามิเตอร์ | ค่า | คำอธิบาย |
---|---|---|
พารามิเตอร์เส้นทาง | ||
accountId |
string |
รหัสบัญชีที่มีกลุ่มเป้าหมายรีมาร์เก็ตติ้งนั้นอยู่ |
remarketingAudienceId |
string |
รหัสของกลุ่มเป้าหมายรีมาร์เก็ตติ้งที่จะลบ |
webPropertyId |
string |
รหัสเว็บพร็อพเพอร์ตี้ที่มีกลุ่มเป้าหมายรีมาร์เก็ตติ้งอยู่ |
การให้สิทธิ์
คำขอนี้ต้องได้รับการให้สิทธิ์ตามขอบเขตต่อไปนี้ (อ่านเพิ่มเติมเกี่ยวกับการตรวจสอบสิทธิ์และการให้สิทธิ์)
ขอบเขต |
---|
https://www.googleapis.com/auth/analytics.edit |
เนื้อหาของคำขอ
อย่าแสดงเนื้อหาของคำขอด้วยวิธีนี้
คำตอบ
หากสำเร็จ เมธอดนี้จะแสดงเนื้อหาการตอบสนองที่ว่างเปล่า
ตัวอย่าง
หมายเหตุ: ตัวอย่างโค้ดที่มีสำหรับวิธีการนี้ไม่ได้แสดงถึงภาษาโปรแกรมที่รองรับทั้งหมด (ดูรายการภาษาที่รองรับได้ในหน้าไลบรารีของไคลเอ็นต์)
Java
/* * Note: This code assumes you have an authorized Analytics service object. * See the Remarketing Audiences Developer Guide for details. */ /* * This request delete an existing Remarketing Audience. */ try { RemarketingAudience audience = analytics.management().remarketingAudience() .delete("123456", "UA-123456-1", "QRSTUVABCD123").execute(); } catch (GoogleJsonResponseException e) { System.err.println("There was a service error: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); }
PHP
/* * Note: This code assumes you have an authorized Analytics service object. * See the Remarketing Audiences Developer Guide for details. */ /* * This request deletes an existing Remarketing Audience. */ try { Google_Service_Analytics_RemarketingAudience $audience = $analytics->management_remarketingAudience->delete($accountId, $propertyId, $remarketingAudienceId); } catch (apiServiceException $e) { print 'There was an Analytics API service error ' . $e->getCode() . ':' . $e->getMessage(); } catch (apiException $e) { print 'There was a general API error ' . $e->getCode() . ':' . $e->getMessage(); }
Python
# Note: This code assumes you have an authorized Analytics service object. # See the Remarketing Audiences Developer Guide for details. # This request deletes an existing Remarketing Audience. try: audience = analytics.management().remarketingAudience().delete( accountId='123456', webPropertyId='UA-123456-1', remarketingAudienceId='122333444455555' ).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))
JavaScript
ใช้ไลบรารีของไคลเอ็นต์ JavaScript
/** * Note: This code assumes you have an authorized Analytics client object. * See the Unsampled Reports Developer Guide for details. */ /** * This request deletes an existing Remarketing Audience. */ function deleteRemarketingAudience(accountId, propertyId, audienceId) { let request = gapi.client.analytics.management.remarketingAudience.delete( { 'accountId': accountId, 'webPropertyId': propertyId, 'remarketingAudienceId': audienceId }); request.execute(function (response) { /* Handle the response. */ }); }