Skip to content

Commit

Permalink
Add items to trackRecommendationView
Browse files Browse the repository at this point in the history
  • Loading branch information
esezen committed Aug 14, 2023
1 parent 9103657 commit f2a50f5
Show file tree
Hide file tree
Showing 21 changed files with 73 additions and 27 deletions.
2 changes: 1 addition & 1 deletion docs/ConstructorIO.html
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/constructorio.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ <h1 class="page-title">constructorio.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2>Development / npm commands</h2>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-autocomplete.html
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -4767,7 +4767,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-catalog.html
Original file line number Diff line number Diff line change
Expand Up @@ -24586,7 +24586,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-quizzes.html
Original file line number Diff line number Diff line change
Expand Up @@ -1690,7 +1690,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-recommendations.html
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-search.html
Original file line number Diff line number Diff line change
Expand Up @@ -2315,7 +2315,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
51 changes: 45 additions & 6 deletions docs/module-tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h4 class="name" id="~on"><span class="type-signature type-signature-inner">(inn

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1611">line 1611</a>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1618">line 1618</a>
</li></ul></dd>


Expand Down Expand Up @@ -1254,7 +1254,7 @@ <h4 class="name" id="~trackBrowseResultClick"><span class="type-signature type-s

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1378">line 1378</a>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1385">line 1385</a>
</li></ul></dd>


Expand Down Expand Up @@ -2382,7 +2382,7 @@ <h4 class="name" id="~trackBrowseResultsLoaded"><span class="type-signature type

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1232">line 1232</a>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1239">line 1239</a>
</li></ul></dd>


Expand Down Expand Up @@ -4564,7 +4564,7 @@ <h4 class="name" id="~trackGenericResultClick"><span class="type-signature type-

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1526">line 1526</a>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1533">line 1533</a>
</li></ul></dd>


Expand Down Expand Up @@ -7727,7 +7727,7 @@ <h4 class="name" id="~trackRecommendationClick"><span class="type-signature type

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1085">line 1085</a>
<a href="modules_tracker.js.html">modules/tracker.js</a>, <a href="modules_tracker.js.html#line1092">line 1092</a>
</li></ul></dd>


Expand Down Expand Up @@ -8901,6 +8901,7 @@ <h5 class="h5-examples">Example</h5>

<pre class="prettyprint"><code>constructorio.tracker.trackRecommendationView(
{
items: [{ itemId: 'KMH876' }, { itemId: 'KMH140' }],
resultCount: 22,
resultPage: 2,
resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
Expand Down Expand Up @@ -9108,6 +9109,44 @@ <h6>Properties</h6>



<tr>

<td class="name"><code>items</code></td>


<td class="type">


<span class="param-type">Array.&lt;object></span>




</td>


<td class="attributes">

&lt;optional><br>





</td>



<td class="default">

</td>


<td class="description last">List of Product Item objects</td>
</tr>



<tr>

<td class="name"><code>resultCount</code></td>
Expand Down Expand Up @@ -13018,7 +13057,7 @@ <h5 class="h5-returns">Returns:</h5>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:35 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_autocomplete.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ <h1 class="page-title">modules/autocomplete.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_browse.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ <h1 class="page-title">modules/browse.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_catalog.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -3542,7 +3542,7 @@ <h1 class="page-title">modules/catalog.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_quizzes.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ <h1 class="page-title">modules/quizzes.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_recommendations.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ <h1 class="page-title">modules/recommendations.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_search.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ <h1 class="page-title">modules/search.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/modules_tasks.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ <h1 class="page-title">modules/tasks.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
9 changes: 8 additions & 1 deletion docs/modules_tracker.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1024,6 +1024,7 @@ <h1 class="page-title">modules/tracker.js</h1>
* @param {string} parameters.url - Current page URL
* @param {string} parameters.podId - Pod identifier
* @param {number} parameters.numResultsViewed - Number of results viewed
* @param {object[]} [parameters.items] - List of Product Item objects
* @param {number} [parameters.resultCount] - Total number of results
* @param {number} [parameters.resultPage] - Page number of results
* @param {string} [parameters.resultId] - Recommendation result identifier (returned in response from Constructor)
Expand All @@ -1046,6 +1047,7 @@ <h1 class="page-title">modules/tracker.js</h1>
* @example
* constructorio.tracker.trackRecommendationView(
* {
* items: [{ itemId: 'KMH876' }, { itemId: 'KMH140' }],
* resultCount: 22,
* resultPage: 2,
* resultId: '019927c2-f955-4020-8b8d-6b21b93cb5a2',
Expand Down Expand Up @@ -1080,6 +1082,7 @@ <h1 class="page-title">modules/tracker.js</h1>
podId = pod_id,
num_results_viewed,
numResultsViewed = num_results_viewed,
items,
} = parameters;

if (!helpers.isNil(resultCount)) {
Expand Down Expand Up @@ -1112,6 +1115,10 @@ <h1 class="page-title">modules/tracker.js</h1>
bodyParams.num_results_viewed = numResultsViewed;
}

if (items &amp;&amp; Array.isArray(items)) {
bodyParams.items = items.slice(0, 100).map((item) => helpers.toSnakeCaseKeys(item, false));
}

const requestUrl = `${requestPath}${applyParamsAsString({}, userParameters, this.options)}`;
const requestMethod = 'POST';
const requestBody = applyParams(bodyParams, userParameters, { ...this.options, requestMethod });
Expand Down Expand Up @@ -1704,7 +1711,7 @@ <h1 class="page-title">modules/tracker.js</h1>
<br class="clear">

<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu Aug 10 2023 16:04:18 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Mon Aug 14 2023 14:51:34 GMT-0400 (Eastern Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
</footer>

<script>prettyPrint();</script>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@constructor-io/constructorio-node",
"version": "4.6.7",
"version": "4.6.8",
"description": "Constructor.io Node.js client",
"main": "src/constructorio.js",
"types": "src/types/constructorio.d.ts",
Expand Down

0 comments on commit f2a50f5

Please sign in to comment.