Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8625547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:48:52+00:00 2026-06-12T07:48:52+00:00

I am using the Google Analytics Api to get web property information from my

  • 0

I am using the Google Analytics Api to get web property information from my Analytics account.

When I log into analaytics though, I only have one website, but through the api I get several (old and deleted sites)

My code is like this:

        var provider = new WebServerClient(GoogleAuthenticationServer.Description)
                           {
                               ClientIdentifier = _appId,
                               ClientSecret = _appSecret
                           };

        var auth = new OAuth2Authenticator<WebServerClient>(provider, x => new AuthorizationState { AccessToken = token });
        var analyticsService = new AnalyticsService(auth);

        var accounts = analyticsService.Management.Accounts.List().Fetch();

        foreach (var account in accounts.Items)
        {
            var webProperties = analyticsService.Management.Webproperties.List(account.Id).Fetch();

            // todo: determine if web property is still in use?
        }

From code how can I tell which ones are still active?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:48:54+00:00Added an answer on June 12, 2026 at 7:48 am

    So after a bit more digging.

    It seems there is no flag or anything like that indicating it has been removed, but if you keep digging into the result set you will notice that at the profile level, a profile that doesn’t have child items seems to be a deleted one.

    Which makes sense I guess there wouldn’t be a profile associated with those that have been removed.

    var provider = new WebServerClient(GoogleAuthenticationServer.Description)
                               {
                                   ClientIdentifier = _appId,
                                   ClientSecret = _appSecret
                               };
    
            var auth = new OAuth2Authenticator<WebServerClient>(provider, x => new AuthorizationState { AccessToken = token });
            var analyticsService = new AnalyticsService(auth);
    
            var accounts = analyticsService.Management.Accounts.List().Fetch();
            var result = new List<Profile>();
    
            foreach (var account in accounts.Items)
            {
                var webProperties = analyticsService.Management.Webproperties.List(account.Id).Fetch();
    
                foreach (var webProperty in webProperties.Items)
                {
                    var profiles = analyticsService.Management.Profiles.List(account.Id, webProperty.Id).Fetch();
    
                    if (profiles.Items != null && profiles.Items.Any())
                    {
                        // these are the ones we want
                        result.AddRange(profiles.Items);
                    }
                }
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this error when trying to get a feed from Google Analytics API.
Using C# I have extracted data from Google Analytics Data API and have got
I'm using a Google Analytics API Class in PHP made by Doug Tan to
I'm using GAPI library (in PHP) for querying Google Analytics API. I request 2
I am using the Google API Client to access Google Analytics. I want to
I've been trying to retrieve Google analytics reports using their provided .NET api and
This is my first time using Google Analytics Ecommerce Tracking to get data for
Using Google Analytics with my Web Pages / Java Script application I just wonder
I am using the GA Data Export API to interact with Google Analytics and
I'm trying to download the 'User Defined' variables using the google analytics API. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.