Mark
Mark

Reputation: 5720

Google Analytics API: Include profile domain in Profile Feed

Using the Google Analytics API I would like to display the domain associated with each GA profile. Is this possible or is there another way to do it? I have been unable to find any documentation for the domain.

http://code.google.com/apis/analytics/docs/gdata/gdataReferenceAccountFeed.html#accountResponse

http://code.google.com/apis/analytics/docs/mgmt/mgmtFeedReference.html#profileFeed

I can't use profileName because depending on how the user has their GA account setup, it may just be a string and not a domain.

Upvotes: 0

Views: 286

Answers (2)

M Schenkel
M Schenkel

Reputation: 6364

One thing you might do is perform a query using ga:hostnames as the dimension and either ga:visits or ga:pageviews as metrics. This will yield a chart of the host name (what is in the browser address bar) to reach that site. Sort of a hack in a way. Technically you can use a single GA Tracking code on multiple sites. So there is no "Official" domain name associated with a profile.

Upvotes: 2

Altonymous
Altonymous

Reputation: 783

Unfortunately, I don't think it's possible with the current API. Furthermore, you can't explicitly depend upon the domain they enter as the only domain the profile is tracking since there is further customization that allows the user to specify if they want to track subdomains and/or top-level domains. I believe your only option is to ask the user the same information Google asks the user and help the user understand they will have to manually keep two lists in sync due to limitations of the Google API.

Upvotes: 0

Related Questions