extract longer shorthost when dealing with doubleclick to distinguish
stats from ads
This commit is contained in:
parent
8d88ba7506
commit
7527288d95
7
util.ts
7
util.ts
|
@ -36,8 +36,11 @@ export function getshorthost(host: string) {
|
||||||
.replace(/^.*:\/\//, "")
|
.replace(/^.*:\/\//, "")
|
||||||
.replace(/\/.*$/, "")
|
.replace(/\/.*$/, "")
|
||||||
.split(".");
|
.split(".");
|
||||||
|
let lookback = parts.at(-2).length > 3 ? -2 : -3;
|
||||||
return parts.slice(parts.at(-2).length > 3 ? -2 : -3).join(".");
|
if (parts.at(-2) == "doubleclick") {
|
||||||
|
lookback = -4; // to distinguish between google ads and stats
|
||||||
|
}
|
||||||
|
return parts.slice(lookback).join(".");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useEmitter(
|
export function useEmitter(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user