diff --git a/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php b/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php index fdd56860..c7b59a3e 100644 --- a/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php +++ b/Public/AdsensePlacement/Infrastructure/Ui/AdsensePlacementRenderer.php @@ -111,15 +111,24 @@ final class AdsensePlacementRenderer { $locationKey = str_replace('-', '_', $location); - // Manejar ubicaciones de in-content (post_content_1, post_content_2, etc.) + // Manejar ubicaciones de in-content legacy (post_content_1, post_content_2, etc.) if (preg_match('/^post_content_(\d+)$/', $locationKey, $matches)) { - // In-content ads heredan la configuracion de post_content + // In-content ads heredan la configuracion de post_content (modo solo parrafos) return [ 'enabled' => $settings['behavior']['post_content_enabled'] ?? false, 'format' => $settings['behavior']['post_content_format'] ?? 'in-article', ]; } + // Manejar ubicaciones de in-content avanzado (post_content_adv_1, post_content_adv_2, etc.) + if (preg_match('/^post_content_adv_(\d+)$/', $locationKey, $matches)) { + // In-content ads avanzados usan configuracion de incontent_advanced + return [ + 'enabled' => true, // Siempre enabled porque ya pasaron los filtros en ContentAdInjector + 'format' => $settings['incontent_advanced']['incontent_format'] ?? 'in-article', + ]; + } + // Mapeo de ubicaciones a grupos y campos $locationMap = [ 'post_top' => ['group' => 'behavior', 'enabled' => 'post_top_enabled', 'format' => 'post_top_format'],