DISQUS

Officially Lucky: Python Google Analytics Client: How to use it and how to help make it better

  • Greg Allard · 8 months ago
    This is awesome. It was pretty easy to get going. It seems like google analytics is unable to produce one type of result that I want though. For a single page on my site I want to know the keywords that got people there or the referrers. I can browse to it on the web interface, but I keep getting bad request errors when I try a way to get that info from them.

    I've tried adding pagePath and keyword as dimensions and I've tried using a filter on pagePath while only having keyword as a dimension. Neither of those would work. Do you have any other ideas I could try?
  • Clint Ecker · 8 months ago
    It looks like that is something called "EntranceKeywords" and doesn't seem to be exposed through the API yet. I thought maybe you could combined pagePath and keywords too... I would think that would work... not sure why it didn't but I'll look into it.
  • Clint Ecker · 8 months ago
    The client has proper multiple dimension support now, you might try it again and see if you meet it with better luck!
  • Greg Allard · 8 months ago
    I gave it another shot and it still wasn't working. I sent a message to the google group and got a response from someone at google. It is a feature that needs to be implemented and it sounds like they will prioritize it since a few people were requesting it. http://groups.google.com/group/google-analytics...
  • RJ · 8 months ago
    Receiving the following error:

    Traceback (most recent call last):
    File "<string>", line 14, in <module>
    AttributeError: 'list' object has no attribute 'get_data'

    My connection string is correct and I'm using the correct account_id. Any ideas???
  • Tomasz Karbownicki · 2 months ago
    ^^ Same here.
  • Alex · 6 months ago
    Hi Clint-

    This lib is exactly what I've been looking for! After only a day of playing with it, I'm already 80% of the way to automating our custom analytics reports (next major hurdle- exporting to excel :P )

    I've hit one minor snag, though- I'm trying to pull the number of keywords used in a month, basically by pulling *all* keywords used in a month and counting the length of the array. However, it appears that even though Analytics says ~4300 keywords were used, the script only returns 1000. I'm assuming it's a hard limit on returns somewhere, as the query returns *exactly* 1000 keywords. I was wondering if this was a switch to turn off somewhere in your library, or it's a hard limit imposed by the API itself? Much appreciated.
  • juju · 6 months ago
    Thank you VERY much, works well and the code is awesome :)
  • Brock · 3 weeks ago
    I can't say how much I love this module. I am somewhat new to programming, but this allowed me to learn a ton about Python all while accomplishing some cool stuff.

    Quick question...is it possible to retrieve the number of results in a query? If my resultset has more than 10k records, I need to page through the results.

    Like I said, I am new to Python, so maybe this answer is obvious, but any help would be great!

    Thanks again!