VirtueMart Forum

VirtueMart Dev/Coding Central: VM1 (old version) => Development Projects, Modifications, Hacks & Tweaks. VM1.1 => Topic started by: Rico Suave on March 29, 2007, 10:57:50 am

Title: How to track "user searches"
Post by: Rico Suave on March 29, 2007, 10:57:50 am
I don't use the enhanced search function, just use the standard search from the VM Module on my website.

I want to track what people are searching for. How can I do that?

Any hints?
Title: Re: How to track "user searches"
Post by: Daan on April 16, 2007, 21:29:30 pm
si si....

try to google the text TFSforjoomla....this works for me!!!

You will see:

IP adresses included their search words etc..
Visitors by country etc
and many more statistics

good luck!
Title: Re: How to track "user searches"
Post by: Rico Suave on May 03, 2007, 14:44:42 pm
thnx friend
Title: Re: How to track "user searches"
Post by: turvas on January 11, 2009, 13:03:40 pm
another way is to use standard VM search and use Joomla Site Seach statistics for that, in VM 1.1.2 and J 1.5.8 works following: add following code snippet to virtuemart_parser.php, somewhere line 180, see it with preceding line:

$keyword = substr( urldecode( vmGet( $_REQUEST, 'keyword' )), 0, 50 );

// log the search in JoomlaSearch statistics by turvas
require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_search'.DS.'helpers'.DS.'search.php' );
SearchHelper::logSearch( $keyword);
Title: Re: How to track "user searches"
Post by: turvas on January 11, 2009, 13:24:17 pm
small fix:
if (!empty($keyword)) {
  require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_search'.DS.'helpers'.DS.'search.php' );
  SearchHelper::logSearch( $keyword);
}
Title: Re: How to track "user searches"
Post by: p.barg on March 27, 2009, 08:43:47 am
Hi,

any idea how this could be achieved with joomla 1.1?

-- Petra
Title: Re: How to track "user searches"
Post by: yomasimo on June 05, 2009, 22:27:15 pm

I need to track searches for virtuemart 1.0.x on joomla 1.0.x

any clues?
Title: Re: How to track "user searches"
Post by: lipes on August 28, 2011, 04:44:48 am
great post Turvas  ... +1 to you!
Title: Re: How to track "user searches"
Post by: turvas on February 16, 2014, 16:50:49 pm
hi again,

just thought I will share my  experience for VM2, same topic - my previous solution works with different placement of code.
I found nice place for it in file components\com_virtuemart\views\category\tmpl\default.php around line 143 or better yet, copy this file to templates\<your template>\html\com_virtuemart\category and make modification there (so they are not lost with VM updates)
Code: [Select]
<?php
  
if (!empty($this->keyword)) {
// 2 lines added by turvas: log/record user searches
require_once(JPATH_SITE.DS.'administrator'.DS.'components'.DS.'com_search'.DS.'helpers'.DS.'search.php' );
SearchHelper::logSearch($this->keyword);
?>