Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong result for No Result Search keyword #13086

Closed
RichardS156 opened this issue Jun 20, 2018 · 4 comments
Closed

Wrong result for No Result Search keyword #13086

RichardS156 opened this issue Jun 20, 2018 · 4 comments
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@RichardS156
Copy link

RichardS156 commented Jun 20, 2018

Wrong result is showing for the keywords under Search Keywords with No Results. For the keywords search results are available.

@sgiehl
Copy link
Member

sgiehl commented Jun 20, 2018

Sorry. I don't fully understand your issue? Are you trying to track site searches with zero results?
If so, searchCount needs to be 0 for your code...

@RichardS156
Copy link
Author

RichardS156 commented Jun 21, 2018

When we search for the keyword Senc ,it returns the search results. But It's appearing in No search keyword result. The same is happening with many other keywords as well.
Code:
var searchValue = $("input[id*='csr_sboxID']").val();
_paq.push(['trackSiteSearch',searchValue,false, 0]);
_paq.push(['trackPageView'])

We have tried using
var searchCount = 15; // set this value when rendering the search result page
_paq.push(['setCustomUrl', document.URL + '&search_count=' + searchCount]);
_paq.push(['trackPageView']);

But no luck.

Could you please suggest if we have to include any other code.

Best regards

@RMastop
Copy link
Contributor

RMastop commented Jun 21, 2018

Hi @Richards,

Try to use the following:
_paq.push(['trackSiteSearch',searchValue,false, searchCount]);
It's not needed to use trackPageView when you use trackSiteSearch.

It looks like you always add a 0 as searchCount, that causes the system to register it as a no-result site search.

Cheers

@sgiehl sgiehl added the answered For when a question was asked and we referred to forum or answered it. label Jun 24, 2018
@sgiehl sgiehl closed this as completed Jun 24, 2018
@RichardS156
Copy link
Author

Hi,

We are using trackSiteSearch code in every search result page as below, but still we have the issue.

  1. This will track the keyword if there are search results appearing on the page.

var searchVal = $("input[id*='csr_sboxID']").val();
if(ctx.DataProvider.get_totalRows() > 0)
{

                _paq.push(['trackSiteSearch',searchVal,false, false]);
                    
                }
  1. This will track the keyword when there are No search results appearing on the page.
                   var searchValue = $("input[id*='csr_sboxID']").val();
                 _paq.push(['trackSiteSearch',searchValue,false, 0]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

3 participants