Record !P & UserAgent in report statistics

(9 posts) (2 voices)

Tags:

No tags yet.

  1. duane, Member

    I have some reports I make available for non-authenticated access. In the report statistics all I see is my authenticated report views and the non-authenticated views. It would be nice if the non-authenticated views recorded IP address and UserAgent so I can see how many 'unique' visitors are to those reports.

    I can get this out of the logs now, but since these variables are picked up by MyDBR, it would be nice if they were stored and reported on for report statistics.

  2. myDBR Team, Key Master

    Sure,
    we can add those.

    --
    myDBR Team

  3. duane, Member

    Hi. I noticed with the latest (2411 build) that this is now implemented. However it produces an error at the top of the main dashboard:

    DB error (1048): Column 'hash' cannot be null SQL: call sp_MyDBR_Stat_AddStart('sp_DBR_Dashboard','MYUSERNAME',2,'call sp_DBR_Dashboard(\'MYUSERNAME\');','MYIPADDRESS',null);

    Somehow it seems that the sp_MyDBR_Stat_AddStart function isn't picking up the useragent to generate the MD5 hash. I took a look quickly at the procedure but couldn't see an obvious problem.

  4. myDBR Team, Key Master

    Duane,
    If the client did not send the user agent (HTTP_USER_AGENT), the hash inadvertently became null. This is now fixed in the latest build. Thank you for pointing this out.

    --
    myDBR Team

  5. duane, Member

    Thanks! Strange that my useragent was not sent, but I've updated it (and the message went away) so I'll see if it picks up the useragent for others (or for other browsers I use). I used Safari 5 in this particular case.

  6. myDBR Team, Key Master

    You can test what are the headers sent:

    <?php
    
    var_dump($_SERVER);

    --
    myDBR Team

  7. duane, Member

    FYI: it does show the useragent:
    ["HTTP_USER_AGENT"]=> string(118) "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.59.10 (KHTML, like Gecko) Version/5.1.9 Safari/534.57.2"

    So I don't know why the inUserAgent would be null when using MyDBR.

  8. myDBR Team, Key Master

    Do you have an entry with hash 'ce16b2cfa4d45692aef09768524f8581' in mydbr_user_agents? That would be the hash of your user agent string.

    --
    myDBR Team

  9. duane, Member

    Yes. So the useragent hash seems to be working. Odd that it wasn't picking it up before you updated it to work if null was returned..but seems to now.


Reply

You must log in to post.