承認が必要です
指定したビュー(旧プロファイル)からユーザーを削除します。 こちらから今すぐお試しいただけます。または、例をご覧ください。
標準パラメータに加えて、このメソッドはパラメータ表に示されているパラメータをサポートしています。
リクエスト
HTTP リクエスト
DELETE https://www.googleapis.com/analytics/v3/management/accounts/accountId/webproperties/webPropertyId/profiles/profileId/entityUserLinks/linkId
パラメータ
パラメータ名 | 値 | 説明 |
---|---|---|
パスパラメータ | ||
accountId |
string |
ユーザーリンクを削除するアカウント ID。 |
linkId |
string |
ユーザーリンクを削除するリンク ID。 |
profileId |
string |
ユーザーリンクを削除するビュー ID(旧プロファイル ID)。 |
webPropertyId |
string |
ユーザーリンクを削除するウェブ プロパティ ID。 |
承認
このリクエストには、次のスコープの承認が必要です(詳細については、認証と承認に関する記事をご覧ください)。
スコープ |
---|
https://www.googleapis.com/auth/analytics.manage.users |
リクエスト本文
リクエスト本文に、management.entityUserLink リソースを含めます。
レスポンス
正常終了した場合、このメソッドはレスポンスの本体を空で返します。
例
注: このメソッドのコード例は、サポートされているすべてのプログラミング言語での例を示しているわけではありません(サポート対象の言語の一覧は、クライアント ライブラリ ページをご覧ください)。
Java
Java クライアント ライブラリを使用します。
/* * Note: This code assumes you have an authorized Analytics service object. * See the User Permissions Developer Guide for details. */ /* * This request deletes an existing Profile User Link. */ try { analytics.management().profileUserLinks().delete("123456", "UA-123456-1", "7654321", "7654321:1111222233334444").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 User Permissions Developer Guide for details. */ // This request deletes an existing View (Profile) User Link. try { $analytics->management_profileUserLinks->delete('123456', 'UA-123456-1', '756321', '756321:111222333444555'); } 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 User Permissions Developer Guide for details. # This request deletes an existing Profile User Link. try: analytics.management().profileUserLinks().delete( accountId='123456', webPropertyId='UA-123456-1', profileId='7654321', linkId='7654321:1111222233334444' ).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 User Permissions Developer Guide for details. */ /* * This request deletes an existing View (Profile) User Link. */ function deleteProfileUserLink() { var request = gapi.client.analytics.management.profileUserLinks.delete( { 'accountId': '123456', 'webPropertyId': 'UA-123456-1', 'profileId': '7654321', 'linkId': '7654321:1111222233334444' }); request.execute(function (response) { // Handle the response. }); }
試してみる
リアルタイムのデータでこのメソッドを呼び出してレスポンスを確認するには、以下の APIs Explorer か、 スタンドアロンの テストツール をご利用ください。