title */ public function get_sections(): array { $sections = [ 'tracking_module_activation' => [ 'title' => __( 'Tracking Settings', 'adpresso' ), 'description' => '', ], 'tracking_frontend' => [ 'title' => __( 'Activate Tracking', 'adpresso' ), 'description' => '', ], '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 { $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' => true, ], ], ], // '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' => 0, ], ], ], ], 'depends_on' => [ [ 'field_id' => 'enable_module_' . $this->get_id(), 'operator' => 'is', 'value' => 1, ], ], 'premium' => true, ], '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' => true, ], 'matomo_url' => [ 'section' => 'tracking_external', 'type' => 'url', 'sanitize_type' => 'url', 'label' => __( 'Matomo URL', 'adpresso' ), 'description' => __( 'Leave empty if Matomo is already on your site (Matomo plugin, Tag Manager or your own code): AdPresso then sends the ad data to that tracker. Fill in the address of your Matomo installation together with the site ID only if AdPresso should load Matomo itself.', 'adpresso' ), 'placeholder' => 'https://matomo.example.com/', 'premium' => true, ], 'matomo_site_id' => [ 'section' => 'tracking_external', 'type' => 'number', 'sanitize_type' => 'uint', 'min' => 1, 'label' => __( 'Matomo site ID', 'adpresso' ), 'description' => __( 'Impressions and clicks show up in Matomo under Behaviour > Contents, one entry per ad.', 'adpresso' ), 'placeholder' => '1', 'premium' => true, ], ]; return apply_filters( "adpresso_tab_{$this->get_id()}_options", $options, $this ); } }