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

Using PHP Tracking Code (Tracewatch) with Magento
 
crventures
Jr. Member
 
Total Posts:  6
Joined:  2009-07-15
 

Hello all!

I run a whole mess of Wordpress sites, and recently, I started using TraceWatch on all of them, and have now been looking in to getting it working with my Magento sites too. TraceWatch requires that you add a little bit of php (or javascript, but php is preferred) to each page in your site, so that it can track visitors. In Wordpress, making this work was as easy as just throwing the php in to footer.php on the server, but so far, I’ve been unable to find out how to do this in Magento. I’ve found places where I can add it to the order process, or to specific places, but not to one spot that will show up on all pages.

Any ideas?

The code in question is:

<?php
include_once $_SERVER[ 'DOCUMENT_ROOT' ].'/twatch/api/LogRequest.php';
twatchLogRequest();
?>

Thanks!

Regards,
Ross Logan

 
Magento Community Magento Community
Magento Community
Magento Community
 
Template fans
Guru
 
Total Posts:  446
Joined:  2009-11-02
 

Go to System --> Configuration --> design --> Footer. Add your code in Miscellaneous HTML.

 
Magento Community Magento Community
Magento Community
Magento Community
 
crventures
Jr. Member
 
Total Posts:  6
Joined:  2009-07-15
 

Ah! I didn’t realize PHP would work in there. I’ll give it a shot.

Thanks so much!

Edit: Tried it - it looks like that does put the code on the page, but it’s not actually executed as php.  I’ll keep digging around.

 
Magento Community Magento Community
Magento Community
Magento Community
 
robin2160
Moderator
 
Avatar
Total Posts:  1046
Joined:  2009-02-15
Berlin / Germany
 

@crventures
Paste the tracking php code in your theme footer.phtml, that works fine.

Regards Stefan

 
Magento Community Magento Community
Magento Community
Magento Community
 
crventures
Jr. Member
 
Total Posts:  6
Joined:  2009-07-15
 

Bingo! That did it!

Thanks so much!

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