title */ public function get_sections(): array { $sections = [ 'tracking_module_activation' => [ 'title' => __( 'Tracking Settings', 'adpresso' ), 'description' => '', ], 'tracking_frontend' => [ 'title' => __( 'Activate Tracking', 'adpresso' ), 'description' => '', ], ]; if ( adpresso_fs()->is_premium() ) { $sections['tracking_external'] = [ 'title' => __( 'External', 'adpresso' ), 'description' => __( 'Send your clicks and impressions to external analytics providers.', 'adpresso' ), ]; } return apply_filters( "adpresso_tab_{$this->get_id()}_sections", $sections, $this ); } /** * Define the options for this settings tab. * * @return array */ protected function define_options(): array { $show_premium_upsells = true; if ( adpresso_fs()->is_premium() ) { $show_premium_upsells = false; } $options = [ 'enable_module_' . $this->get_id() => [ 'type' => 'toggle', 'label' => __( 'Enable Tracking Module', 'adpresso' ), 'description' => __( 'Enables Tracking functionality', 'adpresso' ), 'default' => 0, 'sanitize_type' => 'uint', 'section' => 'tracking_module_activation', 'highlighted' => true, ], 'activate_tracking' => [ 'section' => 'tracking_frontend', 'type' => 'toggle_list', 'sanitize_type' => 'array:key', 'label' => __( 'Activate Tracking', 'adpresso' ), 'options' => [ 'frontend' => [ 'label' => __( 'Local', 'adpresso' ), 'default' => 1, 'description' => __( 'Allow ads to be tracked on the frontend of your website.', 'adpresso' ), 'children' => [ 'activate_active_view' => [ 'label' => __( 'Active View', 'adpresso' ), 'description' => __( "Measure the percentage of impressions in which at least 50% of the ad was visible for 1 second in the user's viewport.", 'adpresso' ), 'default' => 1, 'sanitize_type' => 'uint', 'premium' => $show_premium_upsells, ], ], ], // 'api' => [ // 'label' => __( 'API', 'adpresso' ), // 'default' => 1, // 'description' => __('Allow ads to be tracked via the REST API.', 'adpresso'), // 'children' => [ // 'rest' => ['label' => __('REST API', 'adpresso'), 'default' => 1], // 'rss' => ['label' => __('RSS', 'adpresso'), 'default' => 1], // 'ad_server' => ['label' => __('Ad Server', 'adpresso'), 'default' => 1] // ] // ], ], 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => 1, ], ], ], 'activate_external' => [ 'section' => 'tracking_frontend', 'type' => 'toggle_list', 'sanitize_type' => 'array:key', 'label' => __( 'External tracking', 'adpresso' ), 'options' => [ 'external' => [ 'label' => __( 'External', 'adpresso' ), 'default' => 1, 'description' => __( 'Allow ads to be tracked via external services.', 'adpresso' ), 'children' => [ 'google_analytics' => [ 'label' => __( 'Google Analytics', 'adpresso' ), 'default' => 0 ], // 'matomo' => ['label' => __('Matomo', 'adpresso'), 'default' => 1], // 'clarity' => ['label' => __('Clarity', 'adpresso'), 'default' => 1], ], ], ], 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => 1, ], ], 'premium' => $show_premium_upsells, ], 'analytics_ids' => [ 'section' => 'tracking_external', 'type' => 'text', 'sanitize_type' => 'comma_list', 'label' => __( 'Analytics IDs', 'adpresso' ), 'description' => __( 'One or more Google Analytics properties to which you want the data to be sent. Separate multiple properties with commas. G-A12BC3D456', 'adpresso' ), 'placeholder' => 'G-A12BC3D456, G-A12BC3D457', 'premium' => $show_premium_upsells, ], ]; return apply_filters( "adpresso_tab_{$this->get_id()}_options", $options, $this ); } }