- Description:
- Interface to tracking related API calls
- Source:
Interface to tracking related API calls
Methods
(inner) on(messageType, callback) → {true|Error}
- Description:
- If an error event is emitted and does not have at least one listener registered for the
'error' event, the error is thrown, a stack trace is printed, and the Node.js process
exits - it is best practice to always bind a `.on('error')` handler
- Source:
- See:
-
Example
constructorio.tracker.on('error', (data) => {
// Handle tracking error
});
Parameters:
Name |
Type |
Description |
messageType |
string
|
Type of message to listen for ('success' or 'error') |
callback |
function
|
Callback to be invoked when message received |
Returns:
-
Type
-
true
|
Error
(inner) trackAutocompleteSelect(term, parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User selected (clicked, or navigated to via keyboard) a result that appeared
within autocomplete (Search Suggestions, Products, or a custom section eg. Brands, Categories)
- Source:
Example
constructorio.tracker.trackAutocompleteSelect(
'T-Shirt',
{
originalQuery: 'Shirt',
section: 'Products',
tr: 'click',
groupId: '88JU230',
displayName: 'apparel',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
term |
string
|
|
Term of selected autocomplete item (Search Suggestion or Product name) |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
originalQuery |
string
|
|
The current autocomplete search query |
section |
string
|
|
Section the selected item resides within |
tr |
string
|
<optional>
|
Trigger used to select the item (click, etc.) |
groupId |
string
|
<optional>
|
Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods" |
displayName |
string
|
<optional>
|
Display name of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods" |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackBrowseResultClick(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User clicked a result that appeared within a browse product listing page
- Source:
Example
constructorio.tracker.trackBrowseResultClick(
{
variationId: 'KMH879-7632',
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
resultCount: 22,
resultPage: 2,
resultPositionOnPage: 2,
numResultsPerPage: 12,
selectedFilters: { brand: ['foo'], color: ['black'] },
filterName: 'brand',
filterValue: 'XYZ',
itemId: 'KMH876',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
filterName |
string
|
|
|
Filter name |
filterValue |
string
|
|
|
Filter value |
itemId |
string
|
|
|
Product item unique identifier |
section |
string
|
<optional>
|
"Products"
|
Index section |
variationId |
string
|
<optional>
|
|
Product item variation unique identifier |
resultId |
string
|
<optional>
|
|
Browse result identifier (returned in response from Constructor) |
resultCount |
number
|
<optional>
|
|
Total number of results |
resultPage |
number
|
<optional>
|
|
Page number of results |
resultPositionOnPage |
number
|
<optional>
|
|
Position of clicked item |
numResultsPerPage |
number
|
<optional>
|
|
Number of results shown |
selectedFilters |
object
|
<optional>
|
|
Selected filters |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackBrowseResultsLoaded(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User loaded a browse product listing page
- Source:
Example
constructorio.tracker.trackBrowseResultsLoaded(
{
resultCount: 22,
resultPage: 2,
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
selectedFilters: { brand: ['foo'], color: ['black'] },
sortOrder: 'ascending',
sortBy: 'price',
items: [{ itemId: 'KMH876' }, { itemId: 'KMH140' }],
url: 'https://demo.constructor.io/sandbox/farmstand',
filterName: 'brand',
filterValue: 'XYZ',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
url |
string
|
|
|
Current page URL |
filterName |
string
|
|
|
Filter name |
filterValue |
string
|
|
|
Filter value |
items |
Array.<object>
|
|
|
List of product item objects |
section |
string
|
<optional>
|
"Products"
|
Index section |
resultCount |
number
|
<optional>
|
|
Total number of results |
resultPage |
number
|
<optional>
|
|
Page number of results |
resultId |
string
|
<optional>
|
|
Browse result identifier (returned in response from Constructor) |
selectedFilters |
object
|
<optional>
|
|
Selected filters |
sortOrder |
string
|
<optional>
|
|
Sort order ('ascending' or 'descending') |
sortBy |
string
|
<optional>
|
|
Sorting method |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackConversion(termopt, parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User performed an action indicating interest in an item (add to cart, add to wishlist, etc.)
- Source:
- See:
-
Example
constructorio.tracker.trackConversion(
'T-Shirt',
{
itemId: 'KMH876',
revenue: 12.00,
itemName: 'Red T-Shirt',
variationId: 'KMH879-7632',
type: 'like',
section: 'Products',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
term |
string
|
<optional>
|
Search results query term that led to conversion event |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
itemId |
string
|
|
|
Product item unique identifier |
revenue |
number
|
<optional>
|
|
Sale price if available, otherwise the regular (retail) price of item |
itemName |
string
|
<optional>
|
|
Product item name |
variationId |
string
|
<optional>
|
|
Product item variation unique identifier |
type |
string
|
<optional>
|
'add_to_cart'
|
Conversion type |
isCustomType |
boolean
|
<optional>
|
|
Specify if type is custom conversion type |
displayName |
string
|
<optional>
|
|
Display name for the custom conversion type |
section |
string
|
<optional>
|
|
Index section |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackGenericResultClick(parameters, userParametersopt, networkParametersopt) → {true|Error}
- Description:
- User clicked a result that appeared within a browse product listing page
- Source:
Example
constructorio.tracker.trackGenericResultClick(
{
itemId: 'KMH876',
itemName: 'Red T-Shirt',
variationId: 'KMH879-7632',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
itemId |
string
|
|
|
Product item unique identifier |
itemName |
string
|
<optional>
|
|
Product item name |
variationId |
string
|
<optional>
|
|
Product item variation unique identifier |
section |
string
|
<optional>
|
"Products"
|
Index section |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
<optional>
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
- Description:
- User focused on search input element
- Source:
Example
constructorio.tracker.trackInputFocus({
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: { testName: 'cellName' },
});
Parameters:
Name |
Type |
Attributes |
Description |
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackItemDetailLoad(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User loaded an item detail page
- Source:
Example
constructorio.tracker.trackItemDetailLoad(
{
itemName: 'Red T-Shirt',
itemId: 'KMH876',
url: 'https://constructor.io/product/KMH876',
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
itemName |
string
|
|
Product item name |
itemId |
string
|
|
Product item unique identifier |
url |
string
|
|
Current page URL |
variationId |
string
|
<optional>
|
Product item variation unique identifier |
analyticsTags |
object
|
<optional>
|
Pass additional analytics data |
section |
string
|
<optional>
|
Index section |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackPurchase(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User completed an order (usually fired on order confirmation page)
- Source:
Example
constructorio.tracker.trackPurchase(
{
items: [{ itemId: 'KMH876' }, { itemId: 'KMH140' }],
revenue: 12.00,
orderId: 'OUNXBG2HMA',
section: 'Products',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
items |
Array.<object>
|
|
List of product item objects |
revenue |
number
|
|
The subtotal (excluding taxes, shipping, etc.) of the entire order |
orderId |
string
|
<optional>
|
Unique order identifier |
section |
string
|
<optional>
|
Index section |
analyticsTags |
object
|
<optional>
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackRecommendationClick(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User clicked an item that appeared within a list of recommended results
- Source:
Example
constructorio.tracker.trackRecommendationClick(
{
variationId: 'KMH879-7632',
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
resultCount: 22,
resultPage: 2,
resultPositionOnPage: 2,
numResultsPerPage: 12,
podId: '019927c2-f955-4020',
strategyId: 'complimentary',
itemId: 'KMH876',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
podId |
string
|
|
|
Pod identifier |
strategyId |
string
|
|
|
Strategy identifier |
itemId |
string
|
|
|
Product item unique identifier |
itemName |
string
|
|
|
Product item name |
variationId |
string
|
<optional>
|
|
Product item variation unique identifier |
section |
string
|
<optional>
|
"Products"
|
Index section |
resultId |
string
|
<optional>
|
|
Recommendation result identifier (returned in response from Constructor) |
resultCount |
number
|
<optional>
|
|
Total number of results |
resultPage |
number
|
<optional>
|
|
Page number of results |
resultPositionOnPage |
number
|
<optional>
|
|
Position of result on page |
numResultsPerPage |
number
|
<optional>
|
|
Number of results on page |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackRecommendationView(parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User clicked a result that appeared within a search product listing page
- Source:
Example
constructorio.tracker.trackRecommendationView(
{
items: [{ itemId: 'KMH876' }, { itemId: 'KMH140' }],
resultCount: 22,
resultPage: 2,
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
url: 'https://demo.constructor.io/sandbox/farmstand',
podId: '019927c2-f955-4020',
numResultsViewed: 3,
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Default |
Description |
url |
string
|
|
|
Current page URL |
podId |
string
|
|
|
Pod identifier |
numResultsViewed |
number
|
|
|
Number of results viewed |
items |
Array.<object>
|
<optional>
|
|
List of Product Item objects |
resultCount |
number
|
<optional>
|
|
Total number of results |
resultPage |
number
|
<optional>
|
|
Page number of results |
resultId |
string
|
<optional>
|
|
Recommendation result identifier (returned in response from Constructor) |
section |
string
|
<optional>
|
"Products"
|
Results section |
analyticsTags |
object
|
<optional>
|
|
Pass additional analytics data |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackSearchResultClick(term, parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User clicked a result that appeared within a search product listing page
- Source:
Example
constructorio.tracker.trackSearchResultClick(
'T-Shirt',
{
itemName: 'Red T-Shirt',
itemId: 'KMH876',
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
term |
string
|
|
Search results query term |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
itemName |
string
|
|
Product item name |
itemId |
string
|
|
Product item unique identifier |
variationId |
string
|
<optional>
|
Product item variation unique identifier |
resultId |
string
|
<optional>
|
Search result identifier (returned in response from Constructor) |
itemIsConvertible |
string
|
<optional>
|
Whether or not an item is available for a conversion |
section |
string
|
<optional>
|
The section name for the item Ex. "Products" |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackSearchResultsLoaded(term, parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User loaded a search product listing page
- Source:
Example
constructorio.tracker.trackSearchResultsLoaded(
'T-Shirt',
{
numResults: 167,
itemIds: ['KMH876', 'KMH140', 'KMH437'],
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
term |
string
|
|
Search results query term |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
numResults |
number
|
|
Total number of results |
itemIds |
Array.<string>
|
|
List of product item unique identifiers in search results listing |
section |
string
|
<optional>
|
Index section |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackSearchSubmit(term, parameters, userParameters, networkParametersopt) → {true|Error}
- Description:
- User submitted a search (pressing enter within input element, or clicking submit element)
- Source:
Example
constructorio.tracker.trackSearchSubmit(
'T-Shirt',
{
originalQuery: 'Shirt',
groupId: '88JU230',
displayName: 'apparel',
},
{
sessionId: 1,
clientId: '7a43138f-c87b-29c0-872d-65b00ed0e392',
testCells: {
testName: 'cellName',
},
},
);
Parameters:
Name |
Type |
Attributes |
Description |
term |
string
|
|
Term of submitted autocomplete event |
parameters |
object
|
|
Additional parameters to be sent with request
Properties
Name |
Type |
Attributes |
Description |
originalQuery |
string
|
|
The current autocomplete search query |
groupId |
string
|
<optional>
|
Group identifier of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods" |
displayName |
string
|
<optional>
|
Display name of the group to search within. Only required if searching within a group, i.e. "Pumpkin in Canned Goods" |
|
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error
(inner) trackSessionStart(userParameters, networkParametersopt) → {true|Error}
- Description:
- Send session start event to API
- Source:
Example
constructorio.tracker.trackSessionStart({
sessionId: 1,
clientId: '6c73138f-c27b-49f0-872d-63b00ed0e395',
testCells: { testName: 'cellName' },
});
Parameters:
Name |
Type |
Attributes |
Description |
userParameters |
object
|
|
Parameters relevant to the user request
Properties
Name |
Type |
Attributes |
Description |
sessionId |
number
|
|
Session ID, utilized to personalize results |
clientId |
string
|
|
Client ID, utilized to personalize results |
userId |
string
|
<optional>
|
User ID, utilized to personalize results |
segments |
Array.<string>
|
<optional>
|
User segments |
testCells |
object
|
<optional>
|
User test cells |
originReferrer |
string
|
<optional>
|
Client page URL (including path) |
referer |
string
|
<optional>
|
Client page URL (including path) |
userIp |
string
|
<optional>
|
Client user IP |
userAgent |
string
|
<optional>
|
Client user agent |
acceptLanguage |
string
|
<optional>
|
Client accept language |
dateTime |
string
|
<optional>
|
Time since epoch in milliseconds |
|
networkParameters |
object
|
<optional>
|
Parameters relevant to the network request
Properties
Name |
Type |
Attributes |
Description |
timeout |
number
|
<optional>
|
Request timeout (in milliseconds) |
|
Returns:
-
Type
-
true
|
Error