Files
roi-theme/Schemas/adsense-placement.json
FrankZamora b96a13427e feat(adsense): implementar Anchor Ads y Vignette Ads
- Anchor Ads: anuncios fijos top/bottom con botones minimizar/cerrar
- Vignette Ads: modal fullscreen con triggers configurables
- Schema v1.3.0 con grupos anchor_ads y vignette_ads (18 campos)
- FieldMapper actualizado para persistir settings en BD
- JavaScript para interacción (colapso, cierre, localStorage)
- Soporte para responsive y tamaños fijos en vignette

IMPORTANTE: Ejecutar en servidor remoto:
wp roi-theme sync-component adsense-placement

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-28 21:00:00 -06:00

547 lines
17 KiB
JSON

{
"component_name": "adsense-placement",
"version": "1.3.0",
"description": "Control de AdSense y Google Analytics - Con Anchor y Vignette Ads",
"groups": {
"visibility": {
"label": "Activacion",
"priority": 10,
"fields": {
"is_enabled": {
"type": "boolean",
"label": "Activar AdSense",
"default": false,
"editable": true,
"required": true,
"description": "Activa el control manual de ubicacion de anuncios"
},
"show_on_desktop": {
"type": "boolean",
"label": "Mostrar en escritorio",
"default": true,
"editable": true,
"description": "Muestra anuncios en pantallas desktop (>=992px)"
},
"show_on_mobile": {
"type": "boolean",
"label": "Mostrar en movil",
"default": true,
"editable": true,
"description": "Muestra anuncios en pantallas moviles (<992px)"
},
"hide_for_logged_in": {
"type": "boolean",
"label": "Ocultar para usuarios logueados",
"default": false,
"editable": true,
"description": "No mostrar anuncios a usuarios con sesion iniciada en WordPress"
}
}
},
"analytics": {
"label": "Google Analytics",
"priority": 15,
"fields": {
"analytics_enabled": {
"type": "boolean",
"label": "Activar Analytics",
"default": false,
"editable": true,
"description": "Activa Google Analytics en el sitio"
},
"ga_tracking_id": {
"type": "text",
"label": "Google Analytics ID",
"default": "",
"editable": true,
"description": "ID de seguimiento (G-XXXXXXXXXX o UA-XXXXXXXX-X)"
},
"ga_anonymize_ip": {
"type": "boolean",
"label": "Anonimizar IP (GDPR)",
"default": true,
"editable": true,
"description": "Recomendado para cumplir con GDPR/RGPD"
}
}
},
"content": {
"label": "Credenciales AdSense",
"priority": 20,
"fields": {
"publisher_id": {
"type": "text",
"label": "Publisher ID",
"default": "ca-pub-8476420265998726",
"editable": true,
"description": "Tu ID de publicador de Google AdSense"
},
"slot_display": {
"type": "text",
"label": "Slot Display (fijo)",
"default": "2873062302",
"editable": true,
"description": "Para anuncios de tamano fijo (728x90, 970x250)"
},
"slot_auto": {
"type": "text",
"label": "Slot Auto (responsive)",
"default": "8471732096",
"editable": true,
"description": "Para anuncios responsive"
},
"slot_autorelaxed": {
"type": "text",
"label": "Slot Autorelaxed (feed)",
"default": "9205569855",
"editable": true,
"description": "Para feeds y listados"
},
"slot_inarticle": {
"type": "text",
"label": "Slot In-Article (fluid)",
"default": "7285187368",
"editable": true,
"description": "Para insertar dentro del contenido"
},
"slot_skyscraper": {
"type": "text",
"label": "Slot Skyscraper (160x600 / 300x600)",
"default": "",
"editable": true,
"description": "Para Rail Ads en margenes laterales"
}
}
},
"behavior": {
"label": "Ubicaciones en Posts",
"priority": 70,
"fields": {
"post_top_enabled": {
"type": "boolean",
"label": "Despues de Featured Image",
"default": true,
"editable": true
},
"post_top_format": {
"type": "select",
"label": "Formato Post Top",
"default": "auto",
"editable": true,
"options": ["auto", "in-article", "display", "display-large"]
},
"post_content_enabled": {
"type": "boolean",
"label": "Insertar dentro del contenido",
"default": false,
"editable": true,
"description": "Inserta anuncios automaticamente entre parrafos"
},
"post_content_random_mode": {
"type": "boolean",
"label": "Modo aleatorio",
"default": true,
"editable": true,
"description": "Inserta ads en posiciones aleatorias (mejor UX)"
},
"post_content_min_ads": {
"type": "select",
"label": "Minimo de ads",
"default": "1",
"editable": true,
"options": ["1", "2", "3", "4"],
"description": "Cantidad minima de anuncios a mostrar"
},
"post_content_max_ads": {
"type": "select",
"label": "Maximo de ads",
"default": "3",
"editable": true,
"options": ["1", "2", "3", "4", "5", "6", "7", "8"],
"description": "Cantidad maxima de anuncios a mostrar"
},
"post_content_after_paragraphs": {
"type": "text",
"label": "Primer ad despues del parrafo #",
"default": "3",
"editable": true,
"description": "Numero de parrafo despues del cual insertar el primer ad"
},
"post_content_min_paragraphs_between": {
"type": "select",
"label": "Parrafos minimos entre ads",
"default": "4",
"editable": true,
"options": ["2", "3", "4", "5", "6"],
"description": "Espacio minimo entre anuncios consecutivos"
},
"post_content_format": {
"type": "select",
"label": "Formato Contenido",
"default": "in-article",
"editable": true,
"options": ["in-article", "auto"]
},
"post_bottom_enabled": {
"type": "boolean",
"label": "Despues del contenido",
"default": true,
"editable": true
},
"post_bottom_format": {
"type": "select",
"label": "Formato Post Bottom",
"default": "auto",
"editable": true,
"options": ["auto", "in-article", "display"]
},
"after_related_enabled": {
"type": "boolean",
"label": "Despues de Related Posts",
"default": false,
"editable": true
},
"after_related_format": {
"type": "select",
"label": "Formato After Related",
"default": "autorelaxed",
"editable": true,
"options": ["autorelaxed", "auto"]
},
"rail_ads_enabled": {
"type": "boolean",
"label": "Rail Ads (margenes laterales)",
"default": false,
"editable": true,
"description": "Anuncios fijos en los espacios laterales del viewport (solo pantallas >=1600px)"
},
"rail_left_enabled": {
"type": "boolean",
"label": "Rail izquierdo",
"default": true,
"editable": true
},
"rail_right_enabled": {
"type": "boolean",
"label": "Rail derecho",
"default": true,
"editable": true
},
"rail_format": {
"type": "select",
"label": "Altura Rail Ads",
"default": "h600",
"editable": true,
"options": {
"h250": "250px (Compacto)",
"h300": "300px (Pequeno)",
"h400": "400px (Mediano)",
"h500": "500px",
"h600": "600px (Recomendado)",
"h700": "700px",
"h800": "800px (Grande)",
"h1050": "1050px (Extra grande)"
},
"description": "Altura del anuncio. El ancho se ajusta automaticamente al espacio disponible."
},
"rail_top_offset": {
"type": "select",
"label": "Distancia desde arriba",
"default": "300",
"editable": true,
"options": {
"150": "150px (Cerca del header)",
"200": "200px",
"300": "300px (Recomendado)",
"400": "400px",
"500": "500px",
"700": "700px (Debajo del fold)"
},
"description": "Distancia vertical desde el top del viewport"
}
}
},
"anchor_ads": {
"label": "Anuncios Fijos (Anchor)",
"priority": 71,
"fields": {
"anchor_enabled": {
"type": "boolean",
"label": "Activar Anchor Ads",
"default": false,
"editable": true,
"description": "Anuncios fijos en el borde de la pantalla"
},
"anchor_position": {
"type": "select",
"label": "Posicion del anuncio fijo",
"default": "bottom",
"editable": true,
"options": ["top", "bottom", "both"],
"description": "Solo superior, solo inferior, o ambos"
},
"anchor_height": {
"type": "select",
"label": "Altura del anchor",
"default": "90",
"editable": true,
"options": ["50", "90", "100", "120"],
"description": "Altura en pixeles"
},
"anchor_show_on_mobile": {
"type": "boolean",
"label": "Mostrar en movil",
"default": true,
"editable": true,
"description": "Pantallas menores a 1000px"
},
"anchor_show_on_wide_screens": {
"type": "boolean",
"label": "Permitir en pantallas anchas (>1000px)",
"default": false,
"editable": true,
"description": "Como las de computadora"
},
"anchor_collapsible_enabled": {
"type": "boolean",
"label": "Permitir anchors contraibles",
"default": true,
"editable": true,
"description": "Usuario puede minimizar en lugar de cerrar"
},
"anchor_collapsed_height": {
"type": "select",
"label": "Altura contraido",
"default": "24",
"editable": true,
"options": ["20", "24", "28", "32"],
"description": "Altura cuando esta minimizado"
},
"anchor_collapse_button_text": {
"type": "text",
"label": "Texto boton expandir",
"default": "Ver anuncio",
"editable": true
},
"anchor_close_position": {
"type": "select",
"label": "Posicion boton cerrar",
"default": "right",
"editable": true,
"options": ["left", "right", "center"]
},
"anchor_remember_state": {
"type": "boolean",
"label": "Recordar cierre/colapso",
"default": true,
"editable": true,
"description": "Usa localStorage para recordar estado"
},
"anchor_remember_duration": {
"type": "select",
"label": "Duracion del recuerdo",
"default": "session",
"editable": true,
"options": ["session", "1hour", "1day", "1week"]
}
}
},
"vignette_ads": {
"label": "Anuncios de Vineta (Pantalla Completa)",
"priority": 72,
"fields": {
"vignette_enabled": {
"type": "boolean",
"label": "Activar Vignette Ads",
"default": false,
"editable": true,
"description": "Anuncios pantalla completa entre cargas de pagina"
},
"vignette_trigger": {
"type": "select",
"label": "Cuando mostrar",
"default": "pageview",
"editable": true,
"options": ["pageview", "scroll_50", "scroll_75", "exit_intent", "time_delay"],
"description": "Disparador del vignette"
},
"vignette_trigger_delay": {
"type": "text",
"label": "Delay inicial (segundos)",
"default": "5",
"editable": true,
"description": "Segundos antes de mostrar"
},
"vignette_show_on_mobile": {
"type": "boolean",
"label": "Mostrar en movil",
"default": true,
"editable": true
},
"vignette_show_on_desktop": {
"type": "boolean",
"label": "Mostrar en desktop",
"default": true,
"editable": true
},
"vignette_size": {
"type": "select",
"label": "Tamano del anuncio",
"default": "300x250",
"editable": true,
"options": ["300x250", "336x280", "responsive"]
},
"vignette_overlay_opacity": {
"type": "select",
"label": "Opacidad del fondo",
"default": "0.7",
"editable": true,
"options": ["0.5", "0.6", "0.7", "0.8", "0.9"]
},
"vignette_close_button_delay": {
"type": "select",
"label": "Delay boton cerrar (segundos)",
"default": "0",
"editable": true,
"options": ["0", "1", "2", "3", "5"],
"description": "Segundos antes de mostrar el boton X"
},
"vignette_reshow_enabled": {
"type": "boolean",
"label": "Permitir reaparicion",
"default": true,
"editable": true,
"description": "Puede volver a aparecer despues de cerrarlo"
},
"vignette_reshow_time": {
"type": "select",
"label": "Tiempo para reaparecer (minutos)",
"default": "5",
"editable": true,
"options": ["1", "2", "3", "4", "5", "10", "15", "30"],
"description": "Minutos antes de poder volver a mostrar"
},
"vignette_max_per_session": {
"type": "select",
"label": "Maximo por sesion",
"default": "3",
"editable": true,
"options": ["1", "2", "3", "5", "unlimited"]
},
"vignette_max_per_page": {
"type": "select",
"label": "Maximo por pagina",
"default": "1",
"editable": true,
"options": ["1", "2", "unlimited"]
}
}
},
"layout": {
"label": "Ubicaciones Archivos/Globales",
"priority": 80,
"fields": {
"archive_top_enabled": {
"type": "boolean",
"label": "Arriba del listado (archives)",
"default": false,
"editable": true
},
"archive_between_enabled": {
"type": "boolean",
"label": "Entre posts del listado",
"default": false,
"editable": true
},
"archive_between_every": {
"type": "text",
"label": "Mostrar cada X posts",
"default": "4",
"editable": true,
"description": "Ej: 4 = un anuncio cada 4 posts"
},
"archive_bottom_enabled": {
"type": "boolean",
"label": "Abajo del listado",
"default": false,
"editable": true
},
"archive_format": {
"type": "select",
"label": "Formato para archivos",
"default": "autorelaxed",
"editable": true,
"options": ["autorelaxed", "auto"]
},
"header_below_enabled": {
"type": "boolean",
"label": "Debajo del header (global)",
"default": false,
"editable": true
},
"footer_above_enabled": {
"type": "boolean",
"label": "Arriba del footer (global)",
"default": false,
"editable": true
},
"global_format": {
"type": "select",
"label": "Formato para globales",
"default": "auto",
"editable": true,
"options": ["auto", "display-large"]
}
}
},
"forms": {
"label": "Exclusiones y Rendimiento",
"priority": 90,
"fields": {
"exclude_categories": {
"type": "textarea",
"label": "Excluir categorias (IDs)",
"default": "",
"editable": true,
"description": "IDs de categorias separados por coma (ej: 5,12,23)"
},
"exclude_post_types": {
"type": "textarea",
"label": "Excluir tipos de post",
"default": "",
"editable": true,
"description": "Tipos de post separados por coma (ej: page,attachment)"
},
"exclude_post_ids": {
"type": "textarea",
"label": "Excluir posts especificos (IDs)",
"default": "",
"editable": true,
"description": "IDs de posts/paginas separados por coma"
},
"min_content_length": {
"type": "text",
"label": "Longitud minima de contenido",
"default": "500",
"editable": true,
"description": "No insertar ads si el contenido tiene menos caracteres"
},
"delay_enabled": {
"type": "boolean",
"label": "Retrasar carga de anuncios",
"default": true,
"editable": true,
"description": "Mejora rendimiento: carga ads despues de interaccion"
},
"delay_timeout": {
"type": "text",
"label": "Timeout de delay (ms)",
"default": "5000",
"editable": true,
"description": "Tiempo maximo de espera en milisegundos"
}
}
}
}
}