I'm using the Search Plugin to gather a list of terms the user is searching for on Google. The problem is that the plugin doesn't always return every term that gets searched. This is happening when Google's 'Instant search' feature is enabled.
For example....
1. Search for 'game'
2. Game gets logged as a searched term
3. Append an 's' to the search, which creates a new search of 'games'
4. About 30-50% of the time, the term 'games' will not be logged
5. This also sometime happens when you remove a letter, and turn 'games' into 'game'
For reference, here's the bit of code I'm using to save search terms...
var searchHook = appAPI.hooks.register('searchEngine');
searchHook.addListener('search', function (search) {
_YT.updateEvents([{value:search.term, type:'search', meta: appAPI.utils.getHost(appAPI.dom.location.href).replace(/www\./,"")}]);
});
Disabling 'Instant Search' seems to fix the issue. However, we need to be able to grab all search queries, regardless. Is there any chance this issue will get resolved in the next few weeks?
Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
Search Plugin search listener not always returning the last google search result on Chrome
-
After writing a custom solution, with the search plugin, I found a reason why this might be happening....
Attaching a keyup listener to the search input does not catch keystrokes while the Enter key is down. So, if the user types fast enough, and hits the enter key before letting up on the last letter key, that last letter won't be logged.
The solution....
Add a keydown listener, and log the input value when the key code == 13 (Enter) -
-
Hello Tyler,
Thanks for the update, I was going to suggest a similar thing as currently the Search Plugin does not support Instant Search :-)-
Is there any plan to support Instant Search in the near future?
-
-
Currently, there are no plans to support this in the near future.
-
-
-
-
-
Loading Profile...




EMPLOYEE
