Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Statistics issue when user presses 'return' › Reply To: Statistics issue when user presses 'return'
November 18, 2021 at 9:33 am
#35609
Keymaster
I’m afraid yes, but maybe with a custom code there is a way to trigger it whenever the search results page is displayed.
add_action('posts_results', 'asp_trigger_search_stat');
function asp_trigger_search_stat() {
if ( is_search() && isset($_GET['s']) && $_GET['s'] != '' ) {
asp_statistics::addKeyword(-1, $_GET['s']);
}
}