Searches without relevant hits


I have a Find implementation with tracking applied. It seems to work since both the queries and the clicked hits are displayed in the admin UI under "Most frequent queries". However under "Searches without relevant hits" all the queries are listed with a 0% click-rate. I would understand this if the click-tracking wasn't working, but the JavaScript seems to fire correctly and the clicks shows up under each query in the "Most frequent queries"-list.

Is there some additional step that needs to be made in order to get the data for relevant hits displayed correctly?

Jan 29, 2016 14:17

Check out the guide

and see if you missed a step. Strange that you get parts of it working...

Jan 29, 2016 14:40

Did you add the .Track() extension to your query for example?

Jan 29, 2016 14:41

Thanks for the reply!

I'm doing a multi-search (the same query but with separate resultsets depending on additional parameters) and therefore track the query manually:

  var tags = ServiceLocator.Current.GetInstance<IStatisticTagsHelper>().GetTags().ToList();

  _trackingId = new TrackContext().Id;

  SearchClient.Instance.Statistics().TrackQuery(_trackingQuery, x =>
                x.Id = _trackingId;
                x.Tags = tags;
                x.Query.Hits = totalNumberOfHits;

..and apply the querystring values also manually:

  searchHit.Url = searchHit.Url.AppendQueryStringParameter("_t_id", HttpUtility.UrlEncode(_trackingId));
  searchHit.Url = searchHit.Url.AppendQueryStringParameter("_t_q", HttpUtility.UrlEncode(_trackingQuery));
  searchHit.Url = searchHit.Url.AppendQueryStringParameter("_t_tags", HttpUtility.UrlEncode(_trackingTags));
  searchHit.Url = searchHit.Url.AppendQueryStringParameter("_t_ip", _trackingIP);
  searchHit.Url = searchHit.Url.AppendQueryStringParameter("", string.Format("{0}/{1}", hit.Type, hit.Id));
  searchHit.Url = searchHit.Url.AppendQueryStringParameter("_t_hit.pos", position.ToString());

I've compared the manually generated querystring with one automatically generated from a tracked unified query and they seem to match.

Comparing with the three screenshots from the site, I see clicks like for the search phrase "plan", but in my case "plan" is also displayed under "Searches without relevant hits" with 0% click-rate.

Edited, Jan 29, 2016 15:07

Ok and you've of course checked that your parameter with totalNumberOfHits isn't 0 I guess?

Jan 29, 2016 16:27

Yes, the number of hits are the correct sum of the counts from the multiple queries.

Jan 29, 2016 16:55

Frederik - if you use Fiddler can you see the TrackHit call to Find? 

Feb 02, 2016 10:29

Yes, the request is triggered when the clicked page has loaded and looks like:


The response looks like:


The strange thing is that I see the tracked query in the statistics view as well as the tracked click. But under "Searches without relevant hits" it shows a click-rate of 0%. This occurs in both dev and test environment with different indexes.

Feb 02, 2016 11:13

And you are sure that all of the multisearch queries are "Track() free"? 

Feb 02, 2016 12:24

Yes, there's no Track() in any of the queries. It's all done by a single TrackQuery(..) call. The search count in the statistics UI also seems to indicate this.

Btw, thank you very much for the post! Helped me a lot as I was facing the same requirements :)

Feb 02, 2016 12:50

I would check if _trackingId is correct, so you track clicks for corresponding searches.

Some quotes from documentation:

Use TrackQuery() to track the user query.
It returns a TrackQueryResult with the TrackId.Use the TrackId returned from TrackQuery() to track hits through the existing Javascript.

Could you try to use TrackId from TrackQueryResult returned by SearchClient.Instance.Statistics().TrackQuery(...) method?

Feb 02, 2016 13:24

Great to hear that the blog post was useful! 

In my solution I am handling the TrackHit call to Find my self (by adding a ajax call when the user clicks a search hit). 

Your TrackHit request looks correct, so I would consider filing a bug report to support. 


Feb 02, 2016 13:35

Dmytro - Thanks for the input. I've tried using both the id from a created TrackingContext as well as the id returned through TrackQueryResult, but both methods result in the same outcome; the search is tracked and the click is tracked, but it still shows a 0% click-rate.

Mari - I'm at my wits end so a bug report seems like the next step, thanks!

Feb 02, 2016 14:30

Just to test I implemented Find with the Alloy-demo using unified search. All worked well and the tracking showed up with the correct amount of click through.

I then proceeded to replace the unified search with a projected one adding the same tracking code I'm using in my project. The generated URLs containing the tracking information were identical, yet the tracking only showed queries and clicks under "Most frequent queries", under "Searches without relevant hits" the click-through rate was 0%.

This makes me suspect that the problem might be related to the TrackQuery call, but the parameters seems correct:

  var tags = ServiceLocator.Current.GetInstance<IStatisticTagsHelper>().GetTags().ToList();
  _trackingId = new TrackContext().Id;
  SearchClient.Instance.Statistics().TrackQuery(_trackingQuery, x =>
              x.Id = _trackingId;
              x.Tags = tags;
              x.Query.Hits = totalNumberOfHits;

Anything I might be missing?

Feb 04, 2016 16:44

Think I found the source to the problem. Building my querystring parameters I had called GetTags(false) so there was a missmatch between the initial call and the tracking parameter attached to the URL. The clicks where registered but since the tags didn't match it seems the click-through rate counter ignored these clicks.

Feb 04, 2016 17:49
Nalin - Nov 20, 2020 4:54
Hi Fredrik,

I am also facing same issue which is tracks are showing under Clicks but Click-Through Rate counter 0%.

Just want to confirm with you about the value what you have set on GetTags method. Did you set GetTags(true) in TrackQuery as well as TrackHit methods?

Thank you.

Nice work, Fredrik! Glad you found the problem.

Feb 04, 2016 21:06

Nice catch! I've been following the bug hunt :)

Feb 05, 2016 9:52
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.