From 107ed0a30480813f7a48f46e8016356ff8afa270 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 10 Oct 2026 12:26:30 -0700 Subject: [PATCH 1/3] Record which company a visitor opens. Existing biq events stay. kld_company is sent as well, for the bank and for the examples page. --- examples.html | 1 + index.html | 1 + js/biq-examples.js | 11 +++++++++++ js/biq.js | 19 +++++++++++++++++++ 4 files changed, 32 insertions(+) diff --git a/examples.html b/examples.html index c80c115..94cee0a 100644 --- a/examples.html +++ b/examples.html @@ -35,6 +35,7 @@

Loading question...

+ diff --git a/index.html b/index.html index 2466f2d..71be94c 100644 --- a/index.html +++ b/index.html @@ -43,6 +43,7 @@

Behavioral interview questions

+ diff --git a/js/biq-examples.js b/js/biq-examples.js index ef69d46..283b222 100644 --- a/js/biq-examples.js +++ b/js/biq-examples.js @@ -17,6 +17,11 @@ window.gtag("event", name, clean); } + function kld(name, params) { + if (typeof window.kldTrack !== "function") return; + window.kldTrack(name, params); + } + var params = new URLSearchParams(window.location.search); var principle = params.get("p") || ""; var question = params.get("q") || ""; @@ -30,6 +35,8 @@ var backEl = document.getElementById("biq-ex-back"); if (!questionEl || !statusEl || !sheetEl) return; + kld("app_view", { app: "biq" }); + // Keep the company scope on the way back, so ?c=arm returns to Arm's bank. if (backEl && company) { try { @@ -179,6 +186,7 @@ for (var i = 0; i < companies.length; i++) { if (companies[i].id === target) c = companies[i]; } + if (c && c.id) kld("kld_company", { app: "biq", company: c.id, source: "url" }); var list = pickable(companies, c, bank && bank.facetQuestions); if (!list.length) { statusEl.textContent = "No examples for this set yet. Go back to the questions and pick another principle."; @@ -659,6 +667,9 @@ .then(function (bank) { attachFacetQuestions((bank && bank.companies) || [], bank && bank.facetQuestions); var ctx = resolveContext(bank); + if (ctx.company && ctx.company.id) { + kld("kld_company", { app: "biq", company: ctx.company.id, source: "url" }); + } resolvedPrincipleId = ctx.principle && typeof ctx.principle.id === "number" ? ctx.principle.id : null; renderHeader(ctx); fetchPack(); diff --git a/js/biq.js b/js/biq.js index 0687908..9372603 100644 --- a/js/biq.js +++ b/js/biq.js @@ -15,6 +15,11 @@ window.gtag("event", name, clean); } + function kld(name, params) { + if (typeof window.kldTrack !== "function") return; + window.kldTrack(name, params); + } + function examplesHref(principle, question, level, qid) { // Resolve against the current document, not the origin root, so a relative // examplesPage still works when the site is served from a subdirectory. @@ -33,6 +38,8 @@ var results = document.getElementById("bhiq-results"); if (!input || !chips || !results) return; + kld("app_view", { app: "biq" }); + var lpSelect = null; var LEVELS = ["junior", "senior", "exec"]; var LEVEL_KEY = "bhiq-level"; @@ -295,8 +302,17 @@ var sel = document.getElementById("bhiq-company"); if (!sel) return; sel.addEventListener("change", function () { + var prev = currentCompany ? currentCompany.id : ""; applyCompany(this.value, true); track("biq_company", { biq_company: this.value, biq_page: "bank" }); + if (currentCompany && currentCompany.id && currentCompany.id !== prev) { + kld("kld_company", { + app: "biq", + company: currentCompany.id, + previous_company: prev, + source: "picker" + }); + } }); } @@ -571,6 +587,9 @@ companies = normalizeBank(bank); attachFacetQuestions(companies, bank && bank.facetQuestions); applyCompany(getCompanyId(), false); + if (currentCompany && currentCompany.id) { + kld("kld_company", { app: "biq", company: currentCompany.id, source: "url" }); + } bindCompany(); renderSelects(principles()); renderResults([], ""); From c6de2d01be81f2e1e56b91a775e4d1b6efa30d24 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 10 Oct 2026 13:19:16 -0700 Subject: [PATCH 2/3] Pin the standalone analytics script to an app-kit commit. jsDelivr at main can change without a BIQ review. Both pages now load that commit with subresource integrity. --- examples.html | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples.html b/examples.html index 94cee0a..ab4cbab 100644 --- a/examples.html +++ b/examples.html @@ -35,7 +35,7 @@

Loading question...

- + diff --git a/index.html b/index.html index 71be94c..68e3a2d 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@

Behavioral interview questions

- + From 1845c26b16c7a43b03c4bd22e1e3933ee66e8e11 Mon Sep 17 00:00:00 2001 From: Tig Date: Sat, 10 Oct 2026 14:01:17 -0700 Subject: [PATCH 3/3] Pin the standalone analytics script to the sanitized helper. --- examples.html | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples.html b/examples.html index ab4cbab..eb64cbb 100644 --- a/examples.html +++ b/examples.html @@ -35,7 +35,7 @@

Loading question...

- + diff --git a/index.html b/index.html index 68e3a2d..022cb3a 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@

Behavioral interview questions

- +