Loading...

Last updated: Nov 06 2017

Area: Episerver Perform, Episerver Reach Applies to versions: 1.1 and 1.2 (JavaScript API)

Search results page tracking request

Note: This information applies to JavaScript API versions 1.1 and 1.2. See Search results page (1.3, 1.4) for higher versions.

The search results page is tracked by providing the search term used and the reference codes of the products returned.

Note: Ensure the reference codes match the codes supplied in the catalog feed.

NameDescriptionUsage
searchResults    
     

term

The search term used

 

[string]

 

results

A list of product codes

An array of elements containing a refCode property that indicates the reference codes of the products returned by the search term.

A search page is tracked using the following script.

{
	"type"          : "searchresults",
	"lang"          : "en-gb",
	"searchResults" : {
		"term"    : "hello",
		"results" : [
			{ "refCode" : "RC1"},
			{ "refCode" : "RC2"}
		]
       }
} 

A zero search page (that is, one with no results) is tracked using the following script.

{
	"type"          : "searchresults",
	"lang"          : "en-gb",
	"searchResults" : {
		"term"    : "hello",
		"results" : []
       }
} 

Do you have feedback on this documentation? Send an email to documentation@episerver.com. For development-related questions and discussions, refer to our Forums on https://world.episerver.com/forum/