1 ) { if(!empty($_REQUEST['as_action'])) { $message = $amped_sense->handle_action($_REQUEST['as_action']); } } //note about caching $cacheMessage = ""; $activePlugins = get_option( 'active_plugins' ); $cachePluginNames = array('cache', 'rocket', 'wordfence'); foreach($activePlugins as $activePluginPath) { foreach($cachePluginNames as $cachePluginName) { if(stristr($activePluginPath,$cachePluginName)) { if($amped_sense->settings['render'] == 'client') { $cacheMessage = "Looks like you may be using a caching plugin. Please remember to reset your cache after making changes to your ads. Learn more."; } else { $cacheMessage = "Looks like you may be using a caching plugin. Consider switching to client-side render mode for more equally distributed split testing. Learn more."; } break 2; } } } ?>
settings['segments'][$segmenti]['recipes'][$recipei]; } elseif(isset($_GET['as_copyrecipe'])) { $editingrecipe = true; $whatarewedoing = "Duplicating"; $recipei = $_GET['as_recipei']; $currentrecipe = $amped_sense->settings['segments'][$segmenti]['recipes'][$recipei]; $recipei = -1; //don't pass recipei in form (must do after we retrieve recipe above //now that we have the recipe desired, let's set the segmenti to where they want it copied to $segmenti = $_GET['as_tosegmenti']; //make sure they rename $currentrecipe['recipename'] = ""; $currentrecipe['channelname'] = ""; $currentrecipe['channelid'] = 0; } ?>

Ad Recipe

print_logo(); ?>

An "ad recipe" is a set of ads you want to test against another set of ads.
For example, to see if 1 large ad is better than 2 small ads, create one recipe with 1 large ad, and another recipe with 2 small ads. More Info

-1) echo ""; ?>

Note: Google allows a maximum of 3 ad units and 3 link units per page. Please ensure you are familiar with Google's ad placement policy
settings['lcse_v']) && $amped_sense->settings['lcse_v']=='p') ? 6 : 1; for($i=1; $i <= $j; $i++) { $offset = $i-1; $existingad = isset($currentrecipe['ads'][$offset]) ? $currentrecipe['ads'][$offset] : null; printAdOptions($i,$editingrecipe,$existingad); } ?>

>
>
Create a new custom channel with the Channel Name above in AdSense.
$cacheMessage
"; ?>

Welcome to AmpedSense!

print_logo(); ?>

Congratulations on installing AmpedSense! You're about to run some kick-butt split tests to help you increase your AdSense revenue. Sweet!

$message"; ?> $cacheMessage"; ?> settings['googlerefreshtoken']) || $amped_sense->settings['googlerefreshtoken']=='') { echo "

Login with Google so AmpedSense can retrieve your AdSense settings.
Be sure to use a Google account that is approved for AdSense.

Retrieve AdSense settings

Access is read-only and will not change anything in your account. By authenticating, you agree to our terms.

"; } else { $amped_sense->ensureGoogleAccessToken(); //grab all data from google for each segment date $google_success = false; $apiresults = array(); //indexed by fromdate if(isset($_SESSION['as_googleaccesstoken']) && $_SESSION['as_googleaccesstoken']!="") { foreach($amped_sense->settings['segments'] as $i=>$segment) { //only if not hidden if(!(isset($segment['hide']) && $segment['hide']==1)) { $fromdate = $amped_sense->get_ir_fromdate($i); if(!isset($apiresults[$fromdate])) { $start = date("Y-m-d",strtotime($fromdate)); $end = date("Y-m-d"); $dimension = "CUSTOM_CHANNEL_NAME"; //don't use MATCHED_AD_REQUESTS, because link units count the next page only, and we should factor in unmatched ad requests too //don't use AD_REQUESTS, use PAGE_VIEWS - that's what the adsense portal reports, and it makes most sense $metricclause = "metric=PAGE_VIEWS&metric=CLICKS&metric=PAGE_VIEWS_CTR&metric=PAGE_VIEWS_RPM&metric=EARNINGS"; $returnedjson = $amped_sense->getUrlContents("https://www.googleapis.com/adsense/v1.4/accounts/".urlencode($amped_sense->settings['adsensepublisherid'])."/reports/?access_token=".urlencode($_SESSION['as_googleaccesstoken'])."&userIp=".$amped_sense->ip."&startDate=$start&endDate=$end&useTimezoneReporting=true&dimension=$dimension&$metricclause"); //echo $returnedjson; $apiresult = json_decode($returnedjson,true); if(count($apiresult) && empty($apiresult["error"])) { $google_success = true; $apiresults[$fromdate] = $apiresult; } else { $google_success = false; echo "Error: $returnedjson"; break; } usleep(100000); //.1 second delay for quota mgmt } } } } //foreach segment, list out recipes and how they're doing foreach($amped_sense->settings['segments'] as $i=>$segment) { //only if not hidden if(!(isset($segment['hide']) && $segment['hide']==1)) { $fromdate = $amped_sense->get_ir_fromdate($i); $statsheaderrow = "Page ViewsClicksCTRRPMEarnings"; $irdate = " since $fromdate"; $script = ""; echo "

".$amped_sense->deviceCriteriaToString($segment['devices'])." - $segment[segmentname]

"; echo ""; echo ""; echo $statsheaderrow; if(isset($segment['recipes']) && count($segment['recipes'])) { foreach($segment['recipes'] as $j=>$recipe) { $previewurl = $amped_sense->get_segment_preview_url($i)."?".$amped_sense->get_recipe_preview_qs($recipe); $safenotes = (isset($recipe['notes'])) ? rawurlencode($recipe['notes']) : ''; $notestitle = ($safenotes=='') ? 'Notes' : 'Notes: '.htmlentities($recipe['notes']); echo ""; //actions echo ""; //name echo ""; //date echo ""; //status echo ""; //ad count echo ""; //show stats, or link to stats if($google_success) { if(isset($recipe['channelid']) && $recipe['channelid']>0) { //find corresponding report row $reportrow = null; if(isset($apiresults[$fromdate]['rows']) && count($apiresults[$fromdate]['rows'])) { foreach($apiresults[$fromdate]['rows'] as $row) { if($row[0]==$recipe['channelname']) { $reportrow = $row; break; } } } if($reportrow==null) { echo ""; } else { echo ""; //views echo ""; //clicks echo ""; //ctr echo ""; //rpm echo ""; //earnings } } else { echo ""; } } else { echo ""; } } } else { echo ""; } echo ""; echo "
RecipeDate StartedStatus# AdsStats $irdate
"; echo " "; echo " "; echo ""; echo ""; if($recipe['active']) echo ""; else echo ""; echo "$recipe[recipename]".date("m/d/Y",$recipe['whenstarted']).""; if($recipe['active']) echo "Active"; else echo "Paused"; echo "".count($recipe['ads'])."No data yet (may be delayed up to 1 hour)$reportrow[1]$reportrow[2]".$amped_sense->toPercent($reportrow[3])."%\$$reportrow[4]\$$reportrow[5]Couldn't find channel - please add New Custom Channel named \"$recipe[channelname]\".
Click when done
Google Error. Try again, view stats manually or reauthenticate
No ad recipes yet.
Create new recipe

"; echo $script; } } echo '

Need help? Creating your first split test

'; } //modal for segment selection on clones // this is taken outside of 'ampedsense' div, so must re-add class for bootstrap to take effect ?>

See example sizes: Text Ads | Display Ads | Link Units
> Ex: '5px', or '10px 2px 5px 2px'
>