'; echo '
'; echo '

Multiple Ad Networks / A-B Testing

'; echo '

Multiple Ad Networks can be setup to display ads from different networks without infringing the terms of any network.'; echo 'At a time only ads from one network (Randomly Choosen) will be shown.'; echo 'This feature can also be used to randomly display different sized Ads from the same network.'; echo 'Please note that this option is global and applied to In-Post Ads, Ad Widgets and In-Theme Ads.

'; echo '
'; echo '
'; echo '

Configuration

'; echo '
'; echo ''; } /* End Add Card in Admin Panel */ /* Begin AB Testing Content */ add_action( 'wp_ajax_wp_insert_abtesting_configuration_form_get_content', 'wp_insert_abtesting_configuration_form_get_content' ); function wp_insert_abtesting_configuration_form_get_content() { check_ajax_referer( 'wp-insert', 'wp_insert_nonce' ); $abtestingMode = get_option( 'wp_insert_abtesting_mode', 1 ); $abtestingModes = [ [ 'value' => '1', 'text' => 'Primary Ad Network', ], [ 'value' => '2', 'text' => 'Primary and Secondary Ad Networks', ], [ 'value' => '3', 'text' => 'All Ad Networks', ], ]; echo '
'; $control = new smartlogixControls( [ 'type' => 'radio-group', 'id' => 'wp_insert_abtesting_mode', 'name' => 'wp_insert_abtesting_mode', 'label' => 'Select the Ad Network Setup that best suits you', 'value' => $abtestingMode, 'options' => $abtestingModes, ] ); $control->add_control(); wp_insert_echo_html( $control->HTML ); echo '

'; echo 'Recommended Ad Networks

'; echo 'Google AdSense'; echo '

'; echo '
'; wp_die(); } add_action( 'wp_ajax_wp_insert_abtesting_configuration_form_save_action', 'wp_insert_abtesting_configuration_form_save_action' ); function wp_insert_abtesting_configuration_form_save_action() { check_ajax_referer( 'wp-insert', 'wp_insert_nonce' ); if ( isset( $_POST['wp_insert_abtesting_mode'] ) ) { $abtestingMode = sanitize_key( wp_unslash( $_POST['wp_insert_abtesting_mode'] ) ); if ( in_array( $abtestingMode, [ '1', '2', '3' ], true ) ) { update_option( 'wp_insert_abtesting_mode', $abtestingMode ); } } wp_die(); } /* End AB Testing Content */