Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/latest/latest.dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Simple Analytics - Privacy-first analytics (docs.simpleanalytics.com/script; 2025-06-24; 80f5; v12) */
/* Simple Analytics - Privacy-first analytics (docs.simpleanalytics.com/script; 2025-07-29; 9107; v12) */
/* eslint-env browser */

(function (
Expand Down Expand Up @@ -244,7 +244,7 @@

// The prefix "utm_" is optional with "strictUtm" disabled
// "ref" is only collected when "strictUtm" is disabled
return new RegExp(regex).test(keyValue);
return new RegExp(regex, "i").test(keyValue);
})
.join("&") || undefinedVar
);
Expand Down
2 changes: 1 addition & 1 deletion src/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@

// The prefix "utm_" is optional with "strictUtm" disabled
// "ref" is only collected when "strictUtm" is disabled
return new RegExp(regex).test(keyValue);
return new RegExp(regex, "i").test(keyValue);
})
.join("&") || undefinedVar
);
Expand Down
18 changes: 18 additions & 0 deletions test/unit/pageview-query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,22 @@ describe("pageview query", function () {
done();
}, 10);
});

it("matches allowed params case insensitively", function (done) {
const dom = createDOM({
settings: { autoCollect: false, allowParams: "foo" },
});

dom.window.sa_pageview("/manual?FOO=bar");

setTimeout(() => {
const req = dom.sent.find(
(r) => r.type === "image" && /path=%2Fmanual/.test(r.url)
);
expect(req, "pageview request").to.exist;
const url = new URL(req.url);
expect(url.searchParams.get("query")).to.equal("FOO=bar");
done();
}, 10);
});
});