Commit 7758c65
fix(analytics): attribute referrer to the entry page only
document.referrer is fixed for the whole SPA session, so every in-app
pageview we send (#562/#565) re-credited the entry referrer — e.g. a single
visitor arriving from heise and browsing 20 anchors made heise's referrer
list show all 20 paths. Report the referrer only on the initial load (handled
by count.js); client-side route changes now send an empty referrer via a
callback. External referrers are credited to the landing page only, matching
the intuitive "where did this visit come from" meaning.
Verified with GoatCounter's get_data: with document.referrer = heise, the
landing keeps r="https://www.heise.de" while an SPA anchor view yields r="".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 55ce9e7 commit 7758c65
1 file changed
Lines changed: 12 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
| |||
0 commit comments