プロファイル フィルタリンク: update

承認が必要です

既存のプロファイル フィルタ リンクを更新します。 こちらから今すぐお試しいただくか、をご覧ください。

リクエスト

HTTP リクエスト

PUT https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/profileFilterLinks/linkId

パラメータ

パラメータ名 説明
パスパラメータ
accountId string プロファイル フィルタ リンクが属するアカウントの ID。
linkId string 更新するプロファイル フィルタ リンクの ID。
profileId string フィルタリンクが属するプロファイルの ID。
webPropertyId string プロファイル フィルタ リンクが属するウェブ プロパティの ID。

承認

このリクエストには、次のスコープの承認が必要です(詳細については、認証と承認に関する記事をご覧ください)。

スコープ
https://www.googleapis.com/auth/analytics.edit

リクエスト本文

リクエストの本文では、次のプロパティでプロファイル フィルタ リンク リソースを指定します。

プロパティ名 説明 メモ
省略可能なプロパティ
rank integer 同じプロファイルにリンクされた他のフィルタと比べた場合の、このプロファイル フィルタ リンクのランク。

読み取り専用の操作(一覧表示や取得など)の場合、ランクは常に 1 から始まります。

書き込みの操作(作成、更新、削除など)の場合、0~255 の値(0 と 255 を含む)を指定することができます。リンクをリストの末尾に挿入するには、ランクを指定しないか、リストの最大ランクよりも大きな数にランクを設定します。リンクをリストの先頭に挿入するには、ランクを 1 以下の数字に指定します。新しいリンクが挿入されると、同じランクか低いランクの既存のフィルタはすべて、リストの下位に移動します。リンクを挿入、更新、削除すると、すべてのプロファイル フィルタ リンクの番号が 1 から振り直されます。

書き込み可能

レスポンス

正常終了した場合、このメソッドによってプロファイル フィルタ リンク リソースを含むレスポンスの本文が返されます。

注: このメソッドで使用可能なコード例では、サポートされているプログラミング言語すべての例を示しているわけではありません(サポートされている言語の一覧については、クライアント ライブラリ ページをご覧ください)。

Java

Java クライアント ライブラリを使用します。

/*
 * Note: This code assumes you have an authorized Analytics service object.
 * See the Filters Developer Guide for details.
 */

/*
 * This request updates an existing profile filter link.
 */

// Construct the filter reference.
FilterRef filterRef = new FilterRef();
filterRef.setId("1223334444");

// Construct the body of the request.
ProfileFilterLink body = new ProfileFilterLink();
body.setFilterRef(filterRef);

try {
analytics.management().profileFilterLinks().update("123456",
    "UA-123456-1", "7654321", "11223344", body).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 Analytics service object.
# See the Filters Developer Guide for details.

# This request updates an existing profile filter link.
try:
  analytics.management().profileFilterLinks().update(
      accountId='123456',
      webPropertyId='UA-123456-1',
      profileId='7654321',
      linkId='11223344',
      body={
          'filterRef': {
              'id': '1223334444'
              }
      }
  ).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))

試してみる

リアルタイムのデータでこのメソッドを呼び出してレスポンスを確認するには、以下の APIs Explorer か、スタンドアロンのテストツールをご利用ください。