File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 <script src="https://jebin2.github.io/js/analytics-embed.js"
55 data-project="JellyJump"></script>
66
7- Add data-skip-internal to skip tracking when the user navigated
8- from another page on the same site (prevents double-counting):
9- <script src="..." data-project="JellyJump" data-skip-internal></script>
7+ Add data-skip-referrer to skip tracking when referred from a specific
8+ page (prevents double-counting on internal navigation):
9+ <script src="..." data-project="JellyJump" data-skip-referrer="/JellyJump"></script>
10+ Fires only if document.referrer does NOT contain the given string.
1011 ============================================ */
1112( function ( ) {
1213 const script = document . currentScript ;
1314 const project = script && script . dataset . project ;
1415 if ( ! project ) return ;
1516
16- // Skip if referred from same origin (internal navigation)
17- if ( script . hasAttribute ( 'data-skip-internal' ) && document . referrer ) {
18- try {
19- if ( new URL ( document . referrer ) . origin === window . location . origin ) return ;
20- } catch { }
21- }
17+ // Skip if referred from a specific page (e.g. the landing page)
18+ const skipReferrer = script . dataset . skipReferrer ;
19+ if ( skipReferrer && document . referrer . includes ( skipReferrer ) ) return ;
2220
2321 fetch ( 'https://bfqcfhvpauvvakgmeuhr.supabase.co/rest/v1/events' , {
2422 method : 'POST' ,
You can’t perform that action at this time.
0 commit comments