Prerequisites — before implementing AI Sizing, complete the Cookie consent and Installation steps on the JS Library page. Kleep must not load until the visitor has consented via your CMP, and the library must be loaded site-wide.
Methods
kleep.load — Display Kleep’s CTA
-
Initialize the widget with
kleep.load: -
Add a container where the widget should be displayed on the product page:
This div is used to append our button inside. We leave CSS styling of the button to you during the implementation.
Parameters
kleep.load should be called on each product page (PDP) to load Kleep’s CTA, with the following parameters:
If
lang or market don’t follow their respective conventions or aren’t supported, you’ll see a console warning.Supported languages (ISO 639-1)
Supported languages (ISO 639-1)
If a language you need isn’t in the list below, please contact your Kleep representative.
fr— French (default)br— Brazilianda— Danishde— Germanen— Englishes— Spanishfi— Finnishit— Italianja— Japaneseko— Koreannl— Dutchpl— Polishpt— Portuguesesv— Swedishzh— Chinese
Supported markets (ISO 3166-1 alpha-2)
Supported markets (ISO 3166-1 alpha-2)
AF, AX, AL, DZ, AD, AO, AI, AG, AR, AM, AW, AC, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CA, CV, BQ, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, HR, CU, CW, CY, CZ, CI, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, SZ, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KP, XK, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MG, MW, MY, MV, ML, MT, MQ, MR, MU, YT, MX, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, AN, NC, NZ, NI, NE, NG, NU, NF, MK, NO, OM, PK, PS, PA, PG, PY, PE, PH, PN, PL, PT, QA, CM, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, KR, SS, ES, LK, VC, SD, SR, SJ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TA, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, WF, EH, YE, ZM, ZW, ZZ
Example
kleep.createButton — Recreate Kleep’s CTA
In some cases your website might rebuild components or reload state variables, causing Kleep’s CTA to disappear. Call kleep.createButton to make it reappear.
No parameter is needed — it reuses the information you provided when calling kleep.load, so make sure kleep.load ran first.
kleep.track — Enable tracking & Dashboard access
On top of the sizing functionality, we add tracking so you can measure how the solution performs on your website. Use kleep.track(event_type, event_info) to send information each time a tracked event occurs.
These events track your store’s standard customer journey — a product being viewed, added to cart, or purchased through your usual storefront flow. They are not Kleep-specific actions (e.g. an add-to-cart triggered from the Kleep widget); fire each one wherever it naturally happens on your site.
product_viewed
product_added_to_cart
checkout_completed
kleep.getTrackingId — Get internal Kleep ID
For custom use cases, you can retrieve one of the visitor’s Kleep internal IDs.
It returns either:
null— if the visitor has not used Kleep, or- a UUID — if the visitor has a Kleep tracking ID
