// Function to get query parameter from URL fragment
function getQueryParam(param) {
var fragment = window.location.hash.substring(1);
var params = new URLSearchParams(fragment);
return params.get(param);
}
// Get search term from 'q' parameter
var searchTerm = getQueryParam('q');
if (searchTerm) {
// Searched Site Klaviyo
var _learnq = _learnq || [];
_learnq.push(["track", "Searched Site", {
"SearchTerm": searchTerm,
"SearchTerm (autocorrected)": "null",
"ReturnedResults": "1"
}]);
}