9

I was wondering, where in Magento the visitors' HTTP User Agent Information is used. The log_visitor_info table is pretty big (and for me it seems the user agent information is useless?).

I grepped through the code and all I found were the following three usages:

  • Check for ignored user agents (anyway, not the stored user agent data but the one received from the helper) (see Mage_Log_Model_Visitor, _construct())
  • Adding the user agent information in (Mage_Log_Model_Visitor, initServerData())
  • Saving the visitor information (Mage_Log_Model_Resource_Visitor, _saveVisitorInfo())

Is there any other place (Reports, Menu item in the backend,...) where the HTTP user agent information is shown/needed?

3
  • 2
    I cannot see any other uses for it. It could be useful but I cannot see a current use. Jul 19, 2014 at 9:18
  • I thought the design exceptions in admin used this to match certain themes/packages/etc based on a user agent, but maybe I'm wrong, I'll have to look it up.
    – pspahn
    Jul 22, 2014 at 21:35
  • I would find it immensely useful to put on order receipts, as when a customer claims there is an error in the store it helps tremendously to know their OS/browser combination for troubleshooting/trying to replicate that. I've posted a question here: magento.stackexchange.com/questions/73956/… Jul 10, 2015 at 15:21

1 Answer 1

2

So firstly I cannot see anything that directly uses the user agent stored against the visitor log entry.

The package theme exceptions directly use the $_SERVER['HTTP_USER_AGENT'] value as with the other places that check user agent.

My best guess, and sorry that it is a guess, is that someone thought that maybe it might be useful to store this information. A shop owner may want to see how many visitors are using which browser, but I cannot see currently anything that does this.

1
  • Thanks for checking. It would make sense to use/view the data if it's stored (and not just filling up the database, if log is enabled). Jul 24, 2014 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.