再营销受众群体:delete

需要授权

删除再营销受众群体。 查看示例

请求

HTTP 请求

DELETE https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/remarketingAudiences/remarketingAudienceId

参数

参数名称 说明
路径参数
accountId string 此再营销受众群体所属的帐号 ID。
remarketingAudienceId string 要删除的再营销受众群体的 ID。
webPropertyId string 再营销受众群体所属的网络媒体资源 ID。

授权

此请求需要获得下列范围的授权(详细了解身份验证和授权)。

范围
https://www.googleapis.com/auth/analytics.edit

请求正文

请勿使用此方法提供请求正文。

响应

如果响应成功,此方法会返回空的响应正文。

示例

备注:此方法的代码示例并未列出所有受支持的编程语言(请参阅客户端库页面,查看受支持的语言列表)。

Java

使用 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

使用 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

使用 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. */ });
}