╔═══════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ ADHUB - GUIDA INTEGRAZIONE PER preadas.com (NO CMP) ║ ║ ╚═══════════════════════════════════════════════════════════════════════════╝ Build Date: 2025-12-23 08:43:15 Bundle Version: 2.0.0 (WITHOUT CMP) ⚠️ WARNING: This bundle DOES NOT include Consent Management Platform (CMP) Use only for: - Sites not operating in EU/EEA - Sites with external CMP solution - Sites not requiring GDPR/TCF compliance ═══════════════════════════════════════════════════════════════════════════ 1. INTEGRAZIONE SCRIPT ═══════════════════════════════════════════════════════════════════════════ 🎯 NOVITÀ: Il bundle carica automaticamente Prebid.js e Google Ad Manager! Devi includere SOLO 1 script + i div placeholder. Aggiungi questo script nel
del tuo sito, PRIMA del tag : ALTERNATIVA (per debug/development): ═══════════════════════════════════════════════════════════════════════════ 2. PLACEHOLDER AD UNITS (METODO BASE) ═══════════════════════════════════════════════════════════════════════════ Aggiungi questi div nel del tuo sito, nelle posizioni dove vuoi mostrare gli annunci. Usa gli ID predefiniti per attivare automaticamente gli slot configurati: ═══════════════════════════════════════════════════════════════════════════ 2b. PLACEHOLDER DINAMICI CON size-adhub (METODO FLESSIBILE) ═══════════════════════════════════════════════════════════════════════════ Puoi usare QUALSIASI ID e specificare le dimensioni con l'attributo size-adhub. La libreria rileverà automaticamente questi div e creerà gli slot GAM. SINTASSI: ESEMPI: ATTRIBUTI OPZIONALI: - size-adhub: OBBLIGATORIO - Dimensioni (es. "300x250", "728x90,970x250", "native") - adhub-position: Targeting position per GAM (default: usa l'ID del div) - adhub-type: Targeting type per GAM (default: "display") - adhub-adunit: Ad unit GAM custom (default: usa RON - Run of Network) FORMATI DIMENSIONI SUPPORTATI: | Formato | Esempio | Risultato | |----------------------|--------------------------|------------------------------| | Singola dimensione | size-adhub="300x250" | [[300, 250]] | | Multi-size | size-adhub="728x90,970x250" | [[728, 90], [970, 250]] | | Native | size-adhub="native" | ['fluid', [1, 1]] | | Fluid | size-adhub="fluid" | ['fluid'] | ═══════════════════════════════════════════════════════════════════════════ 3. CSS OPZIONALE (RESPONSIVE) ═══════════════════════════════════════════════════════════════════════════ Aggiungi questo CSS per gestire la visualizzazione responsive degli ad units: ═══════════════════════════════════════════════════════════════════════════ 3b. WIDGET NATIVI ESTERNI (Recommendation Widget) ═══════════════════════════════════════════════════════════════════════════ Il modulo External Widgets permette di inserire widget di recommendation (Nativery, Outbrain, Taboola, o qualsiasi altro) in modo configurabile. ⚠️ IMPORTANTE: Non ci sono script di default. Ogni widget deve avere la propria configurazione completa (HTML + script). METODO 1: PLACEHOLDER MANUALE Inserisci il placeholder nel tuo HTML dove vuoi il widget: La libreria inserirà il contenuto configurato nel placeholder. METODO 2: INSERIMENTO AUTOMATICO Se non inserisci il placeholder, la libreria può crearlo automaticamente in base alla configurazione (targetSelector e position). CONFIGURAZIONE (nel file external-widgets-config.js del sito): Incolla TUTTO il codice fornito dal provider (HTML + script) nel campo "html". La libreria eseguirà automaticamente gli script inclusi. window.AdHubExternalWidgetsConfig = { enabled: true, widgets: [ { type: 'native', placeholderId: 'adhub-native-widget', // Incolla qui TUTTO il codice del widget (HTML + script) html: \` \`, // Posizionamento (opzionale) targetSelector: '.article-content', position: 'after' } ] }; ESEMPI PER PROVIDER: // ═══════════════════════════════════════ // NATIVERY - Copia/incolla il codice fornito // ═══════════════════════════════════════ { type: 'native', placeholderId: 'adhub-nativery', html: \` \` } // ═══════════════════════════════════════ // OUTBRAIN - Copia/incolla il codice fornito // ═══════════════════════════════════════ { type: 'native', placeholderId: 'adhub-outbrain', html: \` \` } // ═══════════════════════════════════════ // WIDGET MULTIPLI (stessa pagina) // ═══════════════════════════════════════ widgets: [ { type: 'native', placeholderId: 'native-1', html: \` \` }, { type: 'native', placeholderId: 'native-2', html: \` \` // Script nat.js già caricato dal primo widget } ] VERIFICA STATO WIDGETS: // In console browser AdHubExternalWidgets.version // Versione modulo window.AdHubExternalWidgetsConfig // Configurazione attiva ═══════════════════════════════════════════════════════════════════════════ 4. GOOGLE AD MANAGER (GAM) INTEGRATION ═══════════════════════════════════════════════════════════════════════════ Il bundle include l'integrazione automatica con Google Ad Manager (GAM). INIZIALIZZAZIONE AUTOMATICA: Il sistema GAM si inizializza automaticamente: 1. Prebid.js si configura 2. GAM definisce gli slot 3. Auction Prebid si avvia 4. Annunci vengono mostrati VERIFICA STATO GAM: // Stato sistema GAM AdHubGAM.getState() // Output: { initialized: true, slotsCreated: true, adsRequested: true, slotsCount: 4 } // Configurazione GAM attiva AdHubGAM.config // Output: { networkCode: '131207395', sitePrefix: 'preadas.com', slots: [...] } // Lista slot configurati AdHubGAM.getSlotCodes() // Output: ['adhub-top-banner', 'adhub-sidebar', 'adhub-in-article', 'adhub-sticky-bottom'] API GAM DISPONIBILI: // Refresh manuale di uno slot AdHubGAM.refreshSlots('adhub-top-banner') // Refresh multipli slot AdHubGAM.refreshSlots(['adhub-top-banner', 'adhub-sidebar']) // Refresh tutti gli slot AdHubGAM.requestAds() // Display slot specifico AdHubGAM.displaySlot('adhub-sidebar') // Distruggi slot (per SPA) AdHubGAM.destroySlots() CONFIGURAZIONE CUSTOM (OPZIONALE): Se hai bisogno di slot GAM personalizzati, crea il file: sites/preadas.com/gam-slots.js window.AdHubGAMConfig = { networkCode: '131207395', sitePrefix: 'preadas.com', slots: [ { code: 'adhub-top-banner', adUnit: '/131207395/preadas.com-top-banner', sizes: [[970, 250], [728, 90]], targeting: { position: 'top' } } // ... altri slot ] }; Poi rebuilda il bundle: ./tools/build/build-site-bundle-no-cmp.sh preadas.com ═══════════════════════════════════════════════════════════════════════════ 5. DEBUG & TESTING ═══════════════════════════════════════════════════════════════════════════ Per testare l'integrazione, apri la console del browser e usa: // === GAM === AdHubGAM.getState() AdHubGAM.getSlotCodes() AdHubGAM.config // === Prebid === pbjs.getBidResponses() pbjs.getAdserverTargeting() // === Configurazione Sito === window.preadas.comDebug.getConfig() window.preadas.comDebug.testBidder('appnexus') window.preadas.comDebug.showSSPConfig() ═══════════════════════════════════════════════════════════════════════════ 6. URL PARAMETERS PER DEBUG ═══════════════════════════════════════════════════════════════════════════ ?debug=1 → Attiva debug AdHub ?debug=ssp → Mostra debug configurazione SSP ?debug=prebid → Attiva debug Prebid.js (console) ?pbjs_debug=true → Debug Prebid dettagliato ═══════════════════════════════════════════════════════════════════════════ 7. VERIFICA INTEGRAZIONE ═══════════════════════════════════════════════════════════════════════════ Checklist: □ Script bundle caricato correttamente (no errori console) □ Prebid.js caricato □ Google Publisher Tag caricato □ Placeholder div presenti nel HTML □ AdHubGAM.getState() mostra initialized: true □ pbjs.getBidResponses() ritorna bid □ Annunci visualizzati nei container ═══════════════════════════════════════════════════════════════════════════ 8. FILE GENERATI ═══════════════════════════════════════════════════════════════════════════ Bundle esteso (debug): dist/preadas.com/adhub-preadas.com-no-cmp.js Bundle minificato (prod): dist/preadas.com/adhub-preadas.com-no-cmp.min.js Guida integrazione: dist/preadas.com/integration-guide-no-cmp.txt ads.txt per publisher: dist/preadas.com/ads.txt ⚠️ IMPORTANTE: Il file ads.txt DEVE essere caricato nella root del dominio! Esempio: https://tuodominio.it/ads.txt Il file ads.txt contiene 735 entry certificate per i network SSP autorizzati. Serve a prevenire frodi pubblicitarie e proteggere i ricavi del publisher. ═══════════════════════════════════════════════════════════════════════════ 9. ADS.TXT - AUTORIZZAZIONE SELLER DIGITALI ═══════════════════════════════════════════════════════════════════════════ Il file ads.txt è OBBLIGATORIO per la monetizzazione pubblicitaria. COSA FARE: 1. Scarica il file: dist/preadas.com/ads.txt 2. Carica nella ROOT del tuo dominio: https://tuodominio.it/ads.txt 3. Verifica accessibilità: curl https://tuodominio.it/ads.txt Il file contiene: - 735 entry certificate di network SSP autorizzati - Entry DIRECT per Google Ad Manager (con il tuo Network Code) - Entry DIRECT per 4W Marketplace, Rich Network, E-volution, etc. - Entry RESELLER per tutti i partner SSP VALIDAZIONE: - Test online: https://adstxtvalidator.com/ - Google validator: https://www.google.com/webmasters/tools/ads-txt-validator Per maggiori info: /docs/ADS-TXT-MANAGEMENT.md ═══════════════════════════════════════════════════════════════════════════ 10. SUPPORTO E DOCUMENTAZIONE ═══════════════════════════════════════════════════════════════════════════ Per problemi o domande: - Guida GAM: /GAM-INTEGRATION.md - Quick start GAM: /README-GAM.md - Guida ads.txt: /docs/ADS-TXT-MANAGEMENT.md - Quick start ads.txt: /README-ADS-TXT.md - Stato sviluppo: /STATO-SVILUPPO.md - Verifica GAM: ./tools/verify-gam-integration.sh preadas.com - Setup GAM manuale: /SETUP-GAM-MANUALE.md ═══════════════════════════════════════════════════════════════════════════ Build by: AdHub Bundle Builder v2.0.0 (NO CMP) Date: 2025-12-23 08:43:15 ═══════════════════════════════════════════════════════════════════════════