2

I have googled but i didnt found what i was looking for.

I want to log, activity from visitors (page views, products added to cart, custom events) and when the visitor log in, associate that activity to the user id. Or if the visitor isn't a customer when she register do the same thing. Or even if the visitor isn't a customer, when she subscribes to the newsletter, associate that activity to their email address.

a) How extensive is the visitor and customer url log actually is? It logs every page view for customers and/or visitors?

b) On visitor_log_url table is a session_id column. Where is set the Lifetime? How is it renewed? How can i call it in order to add it to newsletter_subscriber or to add it on log_quote?

c) Or maybe someone could recommend an extension that does something like this?

Regards, Alex

V: Magento 1.9.3

0

1 Answer 1

1

a) How extensive is the visitor and customer url log actually is? It logs every page view for customers and/or visitors?

Yes. Visitory/Url loging is happening per each page request. This is managing by Mage_Log module. If you look into this module, you can find following configuration in config.xml file.

<frontend>
    <events>
        <controller_action_predispatch>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>initByRequest</method>
                </log>
            </observers>
        </controller_action_predispatch>
        <controller_action_postdispatch>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>saveByRequest</method>
                </log>
            </observers>
        </controller_action_postdispatch>
        <customer_login>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>bindCustomerLogin</method>
                </log>
            </observers>
        </customer_login>
        <customer_logout>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>bindCustomerLogout</method>
                </log>
            </observers>
        </customer_logout>
        <sales_quote_save_after>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>bindQuoteCreate</method>
                </log>
            </observers>
        </sales_quote_save_after>
        <checkout_quote_destroy>
            <observers>
                <log>
                    <class>log/visitor</class>
                    <method>bindQuoteDestroy</method>
                </log>
            </observers>
        </checkout_quote_destroy>
    </events>
</frontend>

Here both controller_action_predispatch and controller_action_postdispatch will be fired in each URL request and correspondingly a log entry will be created/updated.

b) On visitor_log_url table is a session_id column. Where is set the Lifetime? How is it renewed? How can i call it in order to add it to newsletter_subscriber or to add it on log_quote?

Be honest, this question is not clear for me. Basically session id is generated by Mage_Core_Model_Session instance whose life time is purely depends on your system configuration.

c) Or maybe someone could recommend an extension that does something like this?

Sorry, I don't know any extension which extends Magento's default Mage_Log module.

1
  • Thanks @Rajeev. About question B, in /app/code/core/Mage/Log/Model/Visitor.php there is a call to Mage_Core_Model_Session_Abstract. Nov 16, 2016 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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