Statistics recorded for proper site

Vote:
 

Hello,

I've been trying to get the statistics recorded properly and haven't had much luck.  At this point we're just trying to get the query statistics, not the hit.

I tried variations of this

ITypeSearch<LayoutPageData> q = SearchClient.Instance.Search<LayoutPageData>();

// standard filters
q = q.FilterOnCurrentSite().FilterForVisitor().ExcludeDeleted().CurrentlyPublished();

IContentResult<LayoutPageData> results = q.Track().GetContentResult<LayoutPageData>();

But this doesn't track anything.  I'm trying to understand what the scope parameter for Track() is.  The class library documetnation is very unhelpful.  My hope is it would provide examples like Microsoft does.

This code does work, but records it's statistics under "All Websites" .

SearchClient.Instance.Statistics().TrackQuery(queryText);

Is there a way of supplying an appropriate parameter in TrackQuery() with the commandAction?  If so, is it a tag?

I've checked out Henrik's great article here as well:
How to do custom query and click tracking with EPiServer Find

Any help would be greatly appreciated.

Mark

#249298
Edited, Feb 26, 2021 19:37
Vote:
 

I've also tried this, which doesn't seem to do the trick.

			SearchClient.Instance.Statistics().TrackQuery(queryText, cmd =>
			 {
				 cmd.Id = new TrackContext().Id;
				 cmd.Tags = _tagHelper.GetTags();
				 cmd.Query.Hits = results.TotalMatching;
			 });
#249301
Feb 26, 2021 21:25
Vote:
 

Hi Mark

Are you still having issues with tracking? If you're using a demo index we've been having issues lately with delayed track requests. In some cases there tracking requests hasn't been visible in the statistics until a couple of days later.

#250990
Mar 19, 2021 9:55
Vote:
 

Dada,

Thanks for getting back to me.  I haven't had any luck, but I don't think this isn't a demo instance.  Support setup a development one for us.  When the statistics show for "All Websites", it's an instant response.  I can't however get it to show up in one of the two sites we have setup.

Cheers,

Mark

#250998
Mar 19, 2021 12:54
Vote:
 

You should use GetTags(false) to not send all language and site tags. It's only supported to send in one Language ID and one Site ID.

If you still experience this perhaps capturing those requests against _track API endpoint and share them here.

#250999
Mar 19, 2021 13:49
Vote:
 

Sorry, I should have accepted an answer.  I've done that now. Thank you for all the help dada.

Cheers,

Mark

#257258
Jun 28, 2021 15:54
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.