Analytics Getting a list of web properties

Getting a list of web properties

Each Analytics account may have multiple web properties. You can get a list of all of them across all your Analytics accounts as:

foreach (AnalyticsWebProperty webProperty in analytics.GetWebProperties().Items) {
    string webPropertyId = webProperty.Id;
    string webPropertyName = webProperty.Name;
}

Or for a specific Analytics account as:

foreach (AnalyticsWebProperty webProperty in analytics.GetWebProperties(accountId).Items) {
    string webPropertyId = webProperty.Id;
    string webPropertyName = webProperty.Name;
}