Repository navigation
Conversation
…point
Calls GET /recommendations/v1/pages/{page_id}. Shared parameters use the
same wire format as getRecommendations; podOverrides are sent as
pod_overrides[<pod_id>][<param>] in bracket notation.
Each pod's own result_id is stamped onto that pod's results, and one
recommendations.getRecommendations.completed event is dispatched per pod
(with request.pod_id set), so event-driven tracking beacons each pod with
its own result_id. The top-level result_id identifies the page request and
is not used for tracking. A page-level
recommendations.getRecommendationPage.completed event is also dispatched.
getRecommendations output is unchanged; the session/user parameter block
is shared through a helper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
recommendations.getRecommendationPage(pageId, parameters, networkParameters)forGET /recommendations/v1/pages/{page_id}(API reference). A page returns every pod configured on it in one request, deduplicated across pods server-side.What it does
Shared parameters:
itemIds,variationId,section,term,numResults,filters,filterMatchTypes,preFilterExpression,fmtOptions,hiddenFields,variationsMap. They use the same wire format asgetRecommendations, plus the session, user, segment and test-cell parameters.podOverrides: { [podId]: { numResults, filters, filterMatchTypes, preFilterExpression, fmtOptions, hiddenFields, variationsMap } }is sent in bracket notation, e.g.pod_overrides[complete_the_look][filters][color]=red. Each value uses the same encoding as the top-level param: filters and fmt_options as nested brackets,pre_filter_expressionandvariations_mapas JSON strings. An override replaces the page-wide value for that pod; it is not merged. Page-wide keys inside an override (e.g.itemIds) are rejected client-side with a clear error. The server would return 400 for them anyway.Tracking: per-pod
result_id. The top-levelresult_ididentifies the page request and is not a beacon id. For each pod inresponse.pods[], the method:pod.result_idonto each of that pod's results, the waygetRecommendationsstamps itsresult_idcio.client.recommendations.getRecommendations.completedwith{ request: { ...pod.request, pod_id }, response: pod.response, result_id: pod.result_id }, which is exactly the single-pod shape. The beacon's event-driven tracker keys ondetail.request.pod_idanddetail.response.results(autocomplete-uisrc/tracker.js), so each pod is beaconed with its ownresult_idandpod_id.Also dispatches a page-level
cio.client.recommendations.getRecommendationPage.completedevent with the full response.Types:
RecommendationPageParameters,RecommendationPagePodOverride,RecommendationPageResponse,RecommendationPagePod.fmt_optionsreplace semantics:hiddenFieldsis sent insidefmt_options, and an override replaces the page-wide value wholesale. So an override that sets onlyhiddenFieldsdrops the page-widefmtOptionsfor that pod, and vice versa.Back-compat
getRecommendationsbehavior, events and URLs are unchanged. The session/user/test-cell block moved into a shared helper. I generatedgetRecommendationsURLs fromorigin/masterand from this branch with the same inputs (all params incl. hiddenFields, variationsMap, preFilterExpression, numResults=0, user/segments/test cells; no params; hiddenFields only), and they are byte-identical apart from_dt. Nodist/,docs/or version changes.Testing
npm run lint: cleannpm run test:types(tsd): passes, with new page type testsgetRecommendationPage, stubbed fetch, no network): 10 passing. They cover the URL/path, shared params, bracket encoding ofpod_overrides(incl. array filters,num_results=0, JSONpre_filter_expression/variations_map, fmt_options + hiddenFields), no mutation of a sharedfmtOptions, per-podresult_idstamping (page id never used), per-podgetRecommendations.completedevents withrequest.pod_id, the page event, and the rejections (malformed response, missing pageId, page-wide key in override, variationId without itemIds).BUNDLED=true) and ESM (BUNDLED_VARIANT=esm) builds.src/types/tests/*.test-d.ts).describe.skip('getRecommendationPage - live'). The page endpoint is not yet enabled on the test index, and the test index has no page configured (/recommendations/v1/pages/pdp_b2creturns 404).TEST_REQUEST_API_KEY); CI will.Blocked / follow-ups
🤖 Generated with Claude Code