目次

Google Analytics API v3 で 「User does not have sufficient permissions for this profile. [403]」 エラーが発生する - C#

Google Analytics API v3 で 「User does not have sufficient permissions for this profile. [403]」 エラーが発生する場合の対処法について紹介します。
サービス終了に関する注意
Google Universal Analytics はサービスを終了したため、現在はこの記事で紹介しているコードは動作しません。 新しい Google Analytics 4 (GA4) プロパティを利用する必要があります。 GA4プロパティからのデータ取得はこちらの記事を参照してください。

エラー

下記のエラーが発生します。
エラーメッセージ
User does not have sufficient permissions for this profile. [403]
Errors [
 Message[User does not have sufficient permissions for this profile.] Location[ - ] Reason[insufficientPermissions] Domain[global]
]

原因

指定したアカウントが、Google Analyticsのユーザーに登録されていないことが考えられます。

対策

こちらのページの「Google Analytics の設定」の「サービスアカウントの追加」を参照してサービスアカウントをGoogle Analyticsのユーザーに追加します。

著者
iPentecのメインプログラマー
C#, ASP.NET の開発がメイン、少し前まではDelphiを愛用
掲載日: 2015-11-26
iPentec all rights reserverd.