File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -238,10 +238,10 @@ export default function Home({ }) {
238238 }
239239 } , [ JSON . stringify ( mainSession ) , inCrazyGames ] )
240240
241- // Pass hashed email to NitroAds for better ad targeting (logged-in users only)
241+ // Pass hashed email (anonymous) to NitroAds for better ad targeting (logged-in users only, HTTPS only)
242242 useEffect ( ( ) => {
243243 const email = session ?. token ?. email ;
244- if ( ! email || typeof window === 'undefined' || ! window . nitroAds ) return ;
244+ if ( ! email || typeof window === 'undefined' || ! window . nitroAds || window . location . protocol !== 'https:' ) return ;
245245
246246 ( async ( ) => {
247247 try {
@@ -250,7 +250,6 @@ export default function Home({ }) {
250250 const hashBuffer = await crypto . subtle . digest ( 'SHA-256' , data ) ;
251251 const hashArray = Array . from ( new Uint8Array ( hashBuffer ) ) ;
252252 const hashHex = hashArray . map ( b => b . toString ( 16 ) . padStart ( 2 , '0' ) ) . join ( '' ) ;
253- console . log ( "NitroAds ID" , hashHex )
254253 window . nitroAds . addUserToken ( hashHex , 'SHA-256' ) ;
255254 } catch ( e ) {
256255 // Silently fail - ad targeting is non-critical
You can’t perform that action at this time.
0 commit comments