I'm using the dataRangeType of LAST_7_DAYS, which started malfunctioning 
today.  (The same script I ran today did not give me results for 
yesterday.  When I ran it last week, it did give me results for 
'yesterday'.)

In other words, the following test script, when run on July 22, does not 
include data for July 21, but for July 15-July 24.

The test script is:


<?php

$customerId = PUT CUSTOMER ID HERE;

error_reporting(E_STRICT | E_ALL);

$path = $adwordsAPIpath;
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

include('init.php');

require_once UTIL_PATH . '/ReportUtils.php';




// Get AdWordsUser from credentials in "../auth.ini"
// relative to the AdWordsUser.php file's directory.
$user = new AdWordsUser();

    $user->GetAuthToken(); //get the token now; this should force php not 
to fetch the token for each fork()

// Log SOAP XML request and response.
$user->LogDefaults();

// Load ReportDefinitionService so that the required classes are available.
$user->LoadService('ReportDefinitionService', $adwordsVersion);


// Create selector.
$selector = new Selector();
$selector->fields = array('ExternalCustomerId', 'AccountDescriptiveName', 
'PrimaryUserLogin', 'Date', 'AdNetworkType2', 'ValuePerConversion', 
'AveragePosition', 'AverageCpc', 'AverageCpm', 'Ctr', 'CampaignName', 
'CampaignId', 'Status', 'Clicks', 'AccountTimeZoneId', 'ConversionRate', 
'Conversions', 'Cost', 'CostPerConversion', 
'CostPerConversionManyPerClick', 'Amount', 'Impressions', 'InvalidClicks', 
'InvalidClickRate', 'TotalConvValue', 'ConversionsManyPerClick', 
'SearchExactMatchImpressionShare', 'SearchImpressionShare', 
'SearchBudgetLostImpressionShare', 'ContentRankLostImpressionShare');
$selector->predicates[] =
    new Predicate('Status', 'IN', array('ACTIVE', 'DELETED', 'PAUSED'));

// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'CAMPAIGN performance report #' . time();
$reportDefinition->dateRangeType = 'LAST_7_DAYS';
$reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSV';
$reportDefinition->includeZeroImpressions = FALSE;

$options = array('version' => $adwordsVersion, 'returnMoneyInMicros' => 
FALSE);


try
{

    $fileName = "Complex-".$customerId.".csv";
    $path = dirname(__FILE__) . '/test/' . $fileName;

    $user->SetClientCustomerId($customerId);

    ReportUtils::DownloadReport($reportDefinition, $path, $user, $options );

    printf("Report with name '%s' was downloaded to '%s'.\n",
        $reportDefinition->reportName, $fileName);

} catch (Exception $e) {

    print $e->getMessage() . " adwordsId - $customerId \n";

}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to