Search Analytics WordPress Plugin

Search Analytics will keep history of the search terms used by your users and groups them in a way that will show you where are the loopholes in your website’s content.

As a result, it can easily aid you in finding what your users are really searching for on your website and make sure you provide them the content they need.

Features of Search Analytics

  • Record all the search queries made using the standard WordPress search form.
  • Skip searches made by users with certain user roles or with certain IP addresses
  • Exclude duplicate searches made in certain conditions (GDPR compliant)
  • Choose which user roles are allowed to see the statistics
  • Filter statistics by time periods, with/without results, strings/sub strings
  • View each term individual statistics
  • Export data in the current view to CSV
  • Delete certain search terms from history with ease
  • Easily erase all history from the database in case a reset is needed
  • Easy erase history older than in case a general cleanup is needed
  • Dashboard widget for a quick glance over your last week’s search stats
  • Multisite compatible
  • Country Geolocation

Development Road Map

The Search Analytics WordPress Plugin has a clearly defined development road map which you can always check by visiting the Trello Board

Trello Board

Repository

I have added a GitHub repository for the plugin so that whoever wants to contribute to the plugin can do so by making pull requests on GitHub. The link to the repository is: https://github.com/cornelRaiu/search-analytics

Changelog

The plugin changelog can be seen here: Search Analytics – Changelog

Search Analytics in action

21 thoughts on “Search Analytics WordPress Plugin”

  1. Hi there, great Plugin. One short question. We need two different search results.

    1) I am offering
    2) I need

    Right now both results land in the same graphic. But can we make a differentiation? So we need what is someone offering and what do they need?

    Thanks a lot for the answer. Helps us a lot.

    Greetings

    Reply
    • Hi Michael,
      Thank you for the comment.

      I will think about doing some kind of a tagging system so you can tag searches made from different search forms and then filter them in the Search Analytics dashboard.
      Would that work?

      Looking forward to hearing from you,
      Cornel

      Reply
  2. Great plugin, thank you for your hard work! There is a small but annoying bug though: No matter what setting is set under “Only display the statistics and settings page for these user roles” both settings and analytics page are only shown to administrator. Can you provide a fix for this bug? We need for the analytics page to be visible to editors as well. Thanks!

    Reply
    • Hello! Thank you for letting me know about this issue.
      Can you please tell me on what WordPress version do you have this issue?
      I will launch a new version of the plugin with a few tweaks and bug fixes. Also with full latest WP compatibility.

      Thank you!

      Reply
  3. Thanks for your fast response!! The WP version is v4.9.12. Could you maybe provide a fix (i.e. hack) to quicly solve this issue and make the analytics page available to editors until the next version will be released? Thank you very much in advance!

    Reply
    • Hi Nicolai. Thank you for the extra details. I will try to replicate the issue today and as soon as I have a fix I will send you another reply with it.

      Thank you!

      Reply
  4. Just recreated the issue with WP v5.3.2. For some reason the plugin does not show the setting & analytics page for any user other then administrator. The setting “Only display the statistics and settings page for these user roles” is respected somehow though, because if one removes the checkbox for “administrator” no one can view the pages anymore.

    Reply
  5. forgot to mention: the WP v5.3.2 we just recreated the bug on was a vanilla sandbox WP version without any other plugins which could conflict

    Reply
    • Understood. Thank you for the additional verification!
      I will create a fix and send it to you here.

      Also, in the next version of the plugin there will be 2 settings instead of one:
      “Only display the statistics and settings page for these user roles” will become:
      “Only display the statistics to these user roles”
      “Only display the settings page to these user roles”

      That way you will have even more control over the display.
      Thank you!

      Reply
    • Hi. Someone got on the website with those details in the search param. Basically they searched for exactly that.
      The only way to exclude those at the moment is using WordPress filters and actions to stop the execution before it reaches the plugin.

      However, if you look at the Trello board, there is a plan for an exclude feature in version 1.4. I might move that one to version 1.3.2 in case it is something you really need.
      Also, I am thinking of adding a feature for removing all the entries matching certain string patterns so you can clean up the search history.

      Let me know if that is ok. I will work on the fix tomorrow morning and get back to you.

      Reply
  6. An exclude function would be very useful for several reasons!! Would be very nice to have that already in v1.3.2.

    The feature for removing all the entries matching certain string patterns is nice too of course but that’s quite an “expert” feature, so maybe something for v1.4?

    Anyway, thanks for this your great work with this fantastic plugin and also the great support!! Can’t wait for the fix and of course the next version!!

    Reply
    • Hi there, Here is the fix for the issue you mentioned. This is just a temporary fix and it is definitely not ideal, but it works.

      In ‘plugins/search-analytics/admin/includes/class.stats.php’ around the line 92 you will find the `add_admin_menu()` method.

      You have to change the content of that function with this:

      public function add_admin_menu() {
          $this_user_role = mwt_get_current_user_roles();
          $accepted_user_roles = array_intersect( $this_user_role, $this->plugin_options['mwtsa_display_stats_for_role'] );
          if ( ! isset( $this->plugin_options['mwtsa_display_stats_for_role'] ) || ! empty( $accepted_user_roles ) ) {
              add_submenu_page( 'index.php', __( 'Search Analytics', 'mwt-search-analytics' ), __( 'Search Analytics', 'mwt-search-analytics' ), $accepted_user_roles[0], __FILE__, array( $this, 'render_stats_page' ) );
          }
      }

      This adjustment will display the analytics page to the other user roles as well but keep the settings page only visible to the users that have an user role that has the “manage_options” capability

      Reply
      • An update with the included fix was released yesterday. If you update the plugin you should see it all working correctly now. Thank you!

        Reply
  7. Thanks so much for the speedy fix, already applied it and it works like a charm!!

    About this strange “node/” thingy: the term “node” is now occuring for about 1/3 of the time as part of other seemingly normal search terms. I uploaded an excel export for you here:

    https://www.dropbox.com/s/zct0bnf9eo8fkdc/export-c630648d1357106d948b4004c9d42f11.csv?dl=1

    I don’t think anyone would enter “node/” that many times on purpose so maybe this is triggered by some kind of bot?

    Reply
    • The only thing I can think of is some kind of another app or website that links back to the website with the url set as: ‘site-name/?s=node/whatever’

      Or maybe there is an internal area that does links like this. This is a clear use case for the exclude setting I will add in the next update.

      Reply
    • Hello Nicolai!

      I just released a new update that allows you to add sub-strings to exclude searches.

      In this case if you enter “node/” ( without the ” ) in the new field I added in the settings page you will be bale to get rid of all the “node/” search entries.

      Please let me know if that works correctly. It is currently an experimental feature and I am looking forward to receiving some feedback on it.

      Also, if you like the plugin, please add a review on the plugin page. I would really appreciate it and it will help the plugin grow!

      Thank you!
      Cornel

      Reply
  8. Only Administrators can see Dashboard > Search Analytics, even though I have ticked all in General Settings:
    Only display the statistics and settings page for these user roles:
    Administrator
    Editor
    Author
    Contributor
    Subscriber
    SEO Manager
    SEO Editor

    How can I allow an ‘Editor’ to see the full stats?

    Reply
    • Hello Simon.
      Thanks for reaching out!

      This is a bug I am currently aware of which will be fixed in the next update.
      As a quick fix you can follow the instructions here:

      In ‘plugins/search-analytics/admin/includes/class.stats.php’ around the line 92 you will find the `add_admin_menu()` method.

      You have to change the content of that function with this:

      public function add_admin_menu() {
          $this_user_role = mwt_get_current_user_roles();
          $accepted_user_roles = array_intersect( $this_user_role, $this->plugin_options['mwtsa_display_stats_for_role'] );
          if ( ! isset( $this->plugin_options['mwtsa_display_stats_for_role'] ) || ! empty( $accepted_user_roles ) ) {
              add_submenu_page( 'index.php', __( 'Search Analytics', 'mwt-search-analytics' ), __( 'Search Analytics', 'mwt-search-analytics' ), $accepted_user_roles[0], __FILE__, array( $this, 'render_stats_page' ) );
          }
      }

      Please let me know if that helped.

      Reply
    • An update with the included fix was released yesterday. If you update the plugin you should see it all working correctly now. Thank you!

      Reply

Leave a Comment