Viewing 1 replies (of 1 total)
  • Plugin Author Dana Ross

    (@csixty4)

    I’m trying to get a new version out tonight that addresses PHP 7.0 warnings. But since I saw this, I added some JavaScript pseudo-events that might help you code a connection between DWLS and GA.

    Look in daves-wordpress-live-search.js for the LiveSearch.addCallback() method and all the places LiveSearch.invokeCallbacks() is called. You’ll probably want to hook into the ‘BeforeDisplayResults’ callback, like so:

    LiveSearch.addCallback('BeforeDisplayResults', function() {
      console.log('BeforeDisplayResults invoked');
      // Send this request to Google Analytics
    }
    );

    Keep in mind, unless you do something to filter which requests you send, you’re going to see lots of search terms like “a”, “ap”, “app”, “appl”, and finally “apple” which is what the person was actually searching for.

Viewing 1 replies (of 1 total)
  • The topic ‘Google Analytics – Site search?’ is closed to new replies.