Hostname allowlist

호스트명 허용 목록

Include only events from approved website hostnames.

···
html
<div class="host"><div class="head">EVENT HOSTNAME <b>ALLOWLIST GATE</b></div><div class="row"><span id="domain">shop.example</span><div class="gate" id="gate">PASS</div><div class="dest" id="dest">REPORT +1</div></div><div class="allow">ALLOWED: shop.example · app.example</div></div>
css
.host{width:min(86%,590px);font:850 clamp(10px,max(2vmin,1vw),14px)/1.2 sans-serif}.head{display:flex;justify-content:space-between;border-bottom:2px solid var(--fg);padding-bottom:8px}.head b{color:var(--accent)}.row{display:grid;grid-template-columns:1fr auto 1fr;gap:clamp(7px,2vmin,18px);align-items:center;margin:clamp(22px,6vmin,45px) 0}.row span,.gate,.dest{padding:clamp(9px,2vmin,17px) clamp(6px,1.5vmin,12px);text-align:center;border:1px solid var(--line);background:var(--surface);white-space:nowrap;font-size:clamp(10px,max(1.7vmin,1vw),13px)}.gate{background:var(--accent);color:var(--bg);border-color:var(--accent);transition:background .45s}.gate.block{background:var(--fg);border-color:var(--fg)}.dest{transition:opacity .45s}.dest.dim{opacity:.25}.allow{border-top:1px solid var(--line);padding-top:9px;color:var(--muted);font-size:clamp(10px,max(1.6vmin,1vw),12px)}
js
let bad=false;function draw(){document.querySelector('#domain').textContent=bad?'unknown.example':'shop.example';document.querySelector('#gate').textContent=bad?'BLOCK':'PASS';document.querySelector('#gate').classList.toggle('block',bad);document.querySelector('#dest').textContent=bad?'REPORT +0':'REPORT +1';document.querySelector('#dest').classList.toggle('dim',bad)}draw();setInterval(()=>{bad=!bad;draw()},1650);

Events from unfamiliar hostnames can contaminate an analytics property. An allowlist includes only events from approved domains.

In the demo, an approved visit passes the gate while another hostname is blocked. GA4 announced hostname Include filters in September 2026.

Review legitimate subdomains, checkout, and preview hosts before applying a filter. GA4 notes that these filters do not apply to Measurement Protocol events.

When to use

Use it when spam or unauthorized hostnames pollute reports.

Open as page ↗