A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi Markus Andersson,
May be this helps
public static string TrackQuery(string query, int noOfHits = 1)
{
var id = new TrackContext().Id;
SearchClient.Instance.Statistics().TrackQuery(query, x =>
{
x.Id = id;
x.Tags = GetTags();
x.Query.Hits = noOfHits;
});
return id;
}
Hi,
And thank you! It worked the way I expected.
However, I find it weird that you have to do this manually when using Unified Search.
Glad it helped.
Just one thing GetTags() function is just this line
ServiceLocator.Current.GetInstance<IStatisticTagsHelper>().GetTags()
Hi,
Is it possible to track search phrases (most common/without hits) when using unified search? If so, can anyone provide some dummy code on how to achieve this?
Note that I don't want to track clicks or anything, just the search phrases. I tried enabling click tracking but ended up with this ugly URL which I don't want to expose to the end user.
We're using EPiServer CMS 10.10.4.0 along with EPiServer Find 12.6.2.0.
Thanks!