JSFiddle - React, Tailwind, and code Playground
by algor
JavaScript
function cmCreatePageviewTag(pageID, categoryID, searchString, searchResults, attributes, extraFields) {
console.log("page ID: " + pageID);
console.log("category ID: " + categoryID);
console.log("search String: " + searchString);
console.log("searchResults: " + searchResults);
console.log("attributes: " + attributes);
console.log("extraFields: " + extraFields);
}
(function() {
var host = /^(beta-\d{2})\./.exec(document.location.host), tag = "cmCreatePageviewTag", sep = "-_-", fn;
console.log(host);
if (host && typeof(fn = window[tag]) == "function") {
host = host[1] + "-";
window[tag] = function(pID, cID, srchTerm, srchRes, attr, extra) {
pID = pID ? host + pID : pID, cID = cID ? host + cID : cID; attr = attr ? attr + sep + host : host;
fn(pID, cID, srchTerm, srchRes, attr, extra);
};
}
})();
cmCreatePageviewTag("home", "homeCat");