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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:05:41+00:00 2026-05-27T22:05:41+00:00

i’m developing a sidebar to integrate google analytics stats beside my posts details in

  • 0

i’m developing a sidebar to integrate google analytics stats beside my posts details in the administration.

To understand google analytics api I made some test using the data feed query explorer provided by Google itself.

After few tests I noticed a strange behavior that i’ll resume with a practical example.
I need to know what keywords bring people to a given url and I want to know how many clicks I got from any of these keywords. I also want 3 different data ranges for these informations: daily keywords, monthly keywords and overall keywords…

This is the set of parameters I used:

ids         = <myTableId>
dimensions  = ga:keyword
metrics     = ga:visits
segment     =
filters     = ga:pagePath=~<myUrl>$
sort        =
start-date  =
end-date    =
start-index =
max-results =
max-results = 50

When I try to retrieve data for a single day (eg. start-date = 2011-12-27 and end-date = 2011-12-27) everything seems to work properly.

For example for my url /programmazione/lo-schiaccianoci-in-3d-andrei-konchalovsky-2-dicembre-2011.film I got the following results:

ga:keyword                                  ga:visits
---                                         --- 
(not set)                                   1
lo schiaccianoci film a roma                1
lo schiaccianoci film programmazione roma   1
lo schiaccianoci film roma                  1
lo schiaccianoci programmazione a roma      1
programmazione film lo schiaccianoci a roma 1
schiaccianoci film programmazione           1
schiaccianoci film roma                     1

If i extend my time range I start to have strange behaviours. If I extend the request to all the day of the same month of the previous request i expected to have at least all the keywords retrieved for the single day (maybe with an higher number of clicks), but anyway i got fewer results (and also a warning that says “This result is based on sampled data“):

ga:keyword                      ga:visits 
---                             ---
(not set)                       31
lo schiaccianoci film roma 2011 31

If i try to retrieve allover data (from the first day I created the page to the current day) it gets even worse: I got no data!

So the question is What’s wrong with my approach?

— UPDATE —

I found this bug report: http://code.google.com/p/analytics-issues/issues/detail?id=160
Do you think it’s related?

  • 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-27T22:05:42+00:00Added an answer on May 27, 2026 at 10:05 pm

    If your data is getting sampled then it will be of very poor quality. Sampling appears to be based on the total number of visits, so if you reduce your request to a shorter period of time it will generally eliminate sampling. You saw this yourself when you tried requesting only a single day’s data.

    To fix the problem you must make multiple requests and aggregate it yourself – it makes no sense but that is the only way to fix the problem. We check the sample flag in the result set and reduce the time period and re-request in a loop until we get all clean data.

    My own analysis shows that 40% of the time the sampled number of visits is 5% or more off from the non-sampled value. That’s for visits. Unique visitors is not calculated in sampling at all (it just returns the visits number), and smaller data points like conversions become even more erratic.

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

Sidebar

Related Questions

I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have some data like this: 1 2 3 4 5 9 2 6
That's pretty much it. I'm using Nokogiri to scrape a web page what has

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.