Site Search Tracking

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 6 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #23579


    Hi Ernest,

    Our client wants to track Site Searches, however they don’t use Google Analytics but Piwik (as they need to stay privacy-compliant),
    is it possible toget this working with Ajax Search Pro?

    Thanks in advance,


    Hi Sandy,

    Based on their documentation, it could be possible to connect the two plugins via the API. I would start off with something like this:

    add_action('wp_footer', 'asp_custom_tracking_scpt');
    function asp_custom_tracking_scpt() {
        $(".asp_main_container").on("asp_search_end", function(event, id, instance, phrase) { 
          // Run your tracking function here
          // ..based on their docs, maybe:
          trackEvent('Action', 'Live Search', 'Phrase', phrase);

    I have absolutely no idea if this does anything, but it should call the trackEvent() function (based on their API), when the search ends.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.