The page has been marked as outdated. This generally means that the page was written for either a previous version of the package or a previous version of the underlying API(s).

Getting a list of profiles

A web property may have one ore more profiles (or none at all). You can list all profiles that you have access as:

foreach (AnalyticsProfile profile in analytics.GetProfiles().Items) {
    string profileId = profile.Id;
    string profileName = profile.Name;
}

All profiles for a given Analytics account as:

foreach (AnalyticsProfile profile in analytics.GetProfiles(accountId).Items) {
    string profileId = profile.Id;
    string profileName = profile.Name;
}

Or for a specific web property as:

foreach (AnalyticsProfile profile in analytics.GetProfiles(accountId, webPropertyId).Items) {
    string profileId = profile.Id;
    string profileName = profile.Name;
}