We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 436 ☆ A M B ☆
    • 265 Posts
    Has anybody got the new AjaxSearch 1.9.0 Log Module which is bundled with the main snippet?

    I couldn’t find any installation instructions for the Module either in the downloaded files, here on the forum or on the creators website huh

    When I copy-paste the contents module.ajaxSearchLogManager.txt into a new Module and run it I get this error:



    I checked the database scema and there isn’t a ajaxsearch_log table - but normally Modules create needed database tables themselves?

    Anyone got any ideas?
      MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
      • 5811
      • 1,717 Posts
      I checked the database scema and there isn’t a ajaxsearch_log table - but normally Modules create needed database tables themselves?
      No, the ajaxSearch_log table is created at the first usage of the &asLog parameter. By default asLog has the level 0:0:0 which means that no search logs are registered.

      ---- &asLog - ajaxSearch log [ level [: comment [: purge]]]
              level:
                0 : disallow the ajaxSearch log (default)
                1 : failed search requests are logged
                2 : all ajaxSearch requests are logged
              comment:
                0 : user comment not allowed (default)
                1 : user comment allowed
              purge: number of logs allowed before to do an automatic purge of the table
                0 : no purge allowed (= illimited number of logs)
                default: 200
      
            &asLog=`x` is equivalent to &asLog=`x:0:200`
            &asLog=`x:y` is equivalent to &asLog=`x:y:200`
      
            &asLog=`1:1:500` means that 500 failed search requests possibly commented
                             by the end user could be stored in the ajaxSearch_log table
      
            &asLog=`1:1:500` means that 500 failed search requests possibly commented
                             by the end user could be stored in the ajaxSearch_log table


      Set in your default configuration file $dcfg[’asLog’] = ’2:0:200’; and the table will be created and logs registered in the table.

      If I have enought time, I improve the documentation and add a control in the manager to check if the table already exist.

        • 436 ☆ A M B ☆
        • 265 Posts
        Brilliant! smiley That worked perfectly.

        Yeah, it would be great if there was a check on the database.

        The module is a nice little addition to AjaxSearch! Really impressed my client.
          MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
          • 5811
          • 1,717 Posts
          Thanks Adam. The log of the searches could be a great advantage to follow what are the point of interest of the user site.

          The module provided is for the moment a rought module but as I don’t know really how it is used, I am a bit hesitant to spend time to add some others features.
          Hereafter my prospectives thought when I provided this feature with the release 1.8.3:

          A module will be provided later to manage these search datas.
              We could imagine the following features:
              - drop the table
              - delete (successfull, unsuccessfull, all) searches executed before a specific date
              - delete (successfull, unsuccessfull, all) searches executed before N days
              - give me as meta tag keywords, the N most used (successfull, unsuccessfull) search terms
              - replay a specific search with a new debug level
              - delete uncommented (successfull, unsuccessfull, all) searches
              - filter view with commented (successfull, unsuccessfull, all) searches
          The first feature that I probably add is the pagination of the search results laugh
            • 436 ☆ A M B ☆
            • 265 Posts
            I’m not sure I’d personally use the user comments feature; I’ve never seen that before and I don’t think visitors would leave comments after they search that often. But its a nice idea.

            My clients have often asked if there’s a way to see what people have searched for, and up to now I’ve only been able to extract a little bit of useful data from Google Analytics; but never something as concise as this.

            This module alone will help the client develop their content strategy depending on the site’s search trends smiley

            I think if you were to spend more time developing this module perhaps just add a little more polish (such as location instead of IP, resource titles instead of ID, maybe a way to run that search so the client can see how it originally looked, maybe also let the client delete rows).

            Since I’ve been styling the results page I’ve created about 10 rows in the log, but I can’t find a way to delete them?

            Do you know if there is a better way to integrate the AjaxSearch into Google Analytics? Sometimes with the search highlighting activated the URLs can be skewed and spoil the data.
              MODX Ambassador for Thailand. Managing Director at Monogon, a web design and development studio based in Bangkok, Thailand. - Follow me on Twitter.
              • 5811
              • 1,717 Posts
              I think if you were to spend more time developing this module perhaps just add a little more polish (such as location instead of IP, resource titles instead of ID,
              Thanks for this suggestions. I will deliver a new release with these updates.

              maybe also let the client delete rows
              By using 0 as the third parameter of asLog, you disable the purge. But this need a manual purge of the rows. This is the reason why the default value is 200. As soon as 200 rows are registered, the table is automatically purged.
              I should be probably better to delete only the 100 olders rather to delete all. May be in the next release.

              Since I’ve been styling the results page I’ve created about 10 rows in the log, but I can’t find a way to delete them?
              This is why it is a rough module. A delete button will be welcome.

              Do you know if there is a better way to integrate the AjaxSearch into Google Analytics?
              Look at this post. With the 1.9.0 you could use the $_GET variable, so It should be easier.

              ==== Use Google Analytics to track AjaxSearch
              
                  AjaxSearch forms could now use $_POST or $_GET
                  with $_GET, the query parameter in the URL after you search allow you to track the site 
                  search with Google Analytics.
                  To do this, simply replace method="post" by method="get" in the input template used
                  by your ajaxSearch calls.
                • 2740
                • 95 Posts
                I’ve just installed the AjaxSearch Logs Manager for AS 1.9 and it works perfectly.

                Personally I prefer to see the logging of the IP address kept rather than being replaced by location. Perhaps it can be optional to log one or the other? For me the least useful column is the ’Snippet Call’.

                Thank you for all your work coroico.



                  • 5811
                  • 1,717 Posts
                  If I have enought time, I will improve the documentation and add a control in the manager to check if the table already exist.
                  Done with AjaxSearch190 - 6955