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 3675232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:57:02+00:00 2026-05-19T02:57:02+00:00

Good afternoon! I’ve been searching StackOverflow and the web for about 24 hours now,

  • 0

Good afternoon! I’ve been searching StackOverflow and the web for about 24 hours now, and I haven’t found an answer yet. I hope I’m missing something simple that a more experienced API user can point out for me.

I’m querying the Google Analytics API using their .NET library. This request works:

https://www.google.com/analytics/feeds/data?start-index=1&max-results=500&dimensions=ga:date&end-date=2011-01-06&ids=ga:________&metrics=ga:visitors,ga:visits&start-date=2011-01-06

…but I’d like to filter the results. I’ve tried a single very simple filter which does not require URL encoding:

filters=ga:city!@Minsk

All I get is the maddeningly vague “400 bad request” error. I get the same result using the equals operator:

DataQuery  query = new DataQuery(URL);
...
query.Filters = "ga:city==Minsk"

Ditto if I encode the equals signs as %3D. This gets translated into “ga:city%253D%253DMinsk”, according to the error message. I’ve tried single-quoting “Minsk”, and double-quoting it; no luck.

I’m stumped. Any ideas? Thanks!

  • 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-05-19T02:57:03+00:00Added an answer on May 19, 2026 at 2:57 am

    Found it. It turns out that filters have to be “compatible” with the dimensions and metrics actually expressed in a query. Dropping ga:visitors allowed me to apply most of the filters I needed, though the combination of ga:pagePath and ga:campaign is not allowed with ga:visits… for some reason. Here’s the detail, but be warned: you may end up cross-eyed.

    http://code.google.com/apis/analytics/docs/gdata/gdataReferenceValidCombos.html

    Oh, and using the .NET library you do not need to encode equals signs or spaces in your filters. I structured my filters like this:

    private static readonly string  Filter = string.Join
      (
      ";", new string[]
        {
        "ga:city!=Simi Valley",  // URL encoding is handled for you
        "ga:pagePath!@/splash",
        "ga:pagePath!@static_test",
        "ga:networkLocation!@spring",
        "ga:networkLocation!@equinix asia pacific pte ltd"
        // ...
        }
      );
    

    Hope this helps someone!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good afternoon, I have a web query in Excel 2002 going against a web
Good afternoon, I would ask some suggestion about the best way to monitor events
Good Afternoon, I'm currently planning a web-app/service project with a geolocation-enabled user model (lat/lng
Good afternoon, This should be an easy one. I've done the cookie-cutter default ASP.NET
Good afternoon, with all the buzz around the iPhone / AppStore etc, I felt
Good morning, afternoon, evening or night (depending on your timezone). This is just a
Good morning, I am about to start writing an Excel add-in for Excel 2002.
Good day, We just converted our web application .NET 1.1 to .NET 2.0. We
Good afternoon everyone, I am having an issue with a stored procedure inserting an
Good afternoon, i am currently wrestling with an old .dll which functionality I have

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.