Skip to content

Browser SDK

The browser SDK runs in your pages. It tracks what visitors do, handles their consent and asks Rankrake for recommendations, which you render however you like.

TODO docs: the script tag and the package, once the SDK’s distribution is decided.

TODO docs: loginRankrake with the site’s public key; logoutRankrake, isRankrakeLoggedIn.

TODO docs: the visitor starts as pending and nothing is recorded; grantConsent, revokeConsent, getConsentState. Withdrawing erases what was stored.

TODO docs: trackSessionStart, trackSessionStop, and identifying logged in users with setUserIdentification / removeUserIdentification.

TODO docs: trackClick on an item, and how a click on a recommended item carries the recommendation.

TODO docs: makeRecommendationRequest (strategy, number of items, filters, the page’s item), trackRecommendationShown when the block is visible, and rendering the items.

TODO docs: trackAddToCart and trackPurchase (a whole order, sent as one event per line).

TODO docs: forceFlush and the keepalive option.