Rakesh Advani
Rakesh Advani

Reputation: 45

Is it possible to get Google Analytics data for any website (not my website) using Google Analytics API?

Is it possible to get Google Analytics data for any website (not my website) using Google Analytics API?

I have created Google API for Google Analytics. Then I am trying to access the Google Analytics data for a different profile id.

It is working for my profile id but not other user's profile id.

Upvotes: 0

Views: 507

Answers (2)

kushan_s
kushan_s

Reputation: 313

The Google Analytics API relies on [OAuth 2.0] (https://developers.google.com/analytics/devguides/reporting/core/v3/gdataAuthorization) for authorization. This simply means that the data extraction module you created needs explicit permission to access a Google Analytics Account. Moreover, the scenario you describe about using a different Profile ID wouldn't work due to the nature in which Accounts and Profiles (Views) are [related] (https://support.google.com/analytics/answer/1009618?hl=en) to each other in Google Analytics. So for e.g. if your Google Analytics Account is linked via your email id [email protected], the profile ID that you use to query must correspond to an actual profile in your Google Analytics account. This is the reason why a random Profile ID wouldn't work.

Upvotes: 1

osowskit
osowskit

Reputation: 6344

No. You need to be granted permission to the account or view to access it. GA has documentation here

Upvotes: 2

Related Questions