Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Proper way to run code on EVERY page load. 
 
ShopGuy
Guru
 
Total Posts:  462
Joined:  2008-09-07
 

I am wanting to write a program that determines whether the person accessing the site is a human or a spider and then logs it. My question is, where should I place the code that determines this? It would need to be ran on every page. Where are we supposed to put “global” code like this that should run every time.

 
Magento Community Magento Community
Magento Community
Magento Community
 
retif
Sr. Member
 
Total Posts:  171
Joined:  2008-08-16
Odessa, Ukraine
 

/app/design/frontend/default/default/layout/page.xml

<block type="core/text_list" name="before_body_end" as="before_body_end"/>

this block runs on every page, create another one

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top