Re: Missing TARGETED_MONTHLY_SEARCHES from response
Hi Takeshi Yes, it is still happening, But it is now happening with lesser number of keywords now, may you have not updated your volumes database for all of the keywords yet. Below is the new request and response as well, for the same keyword I posted earlier Can you have a quick look on my request if it is correct Thanks *Request* ?xml version=1.0 encoding=utf-8? soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:xsd=http://www.w3.org/2001/XMLSchema; soap:Header RequestHeader xmlns=https://adwords.google.com/api/adwords/o/v201309; authToken /authToken developerToken/developerToken userAgent/userAgent /RequestHeader /soap:Header soap:Body get xmlns=https://adwords.google.com/api/adwords/o/v201309; selector searchParameters xsi:type=RelatedToQuerySearchParameter queriesholiday kephalona greece/queries /searchParameters searchParameters xsi:type=LocationSearchParameter locations id xmlns=https://adwords.google.com/api/adwords/cm/v201309;2826/id /locations /searchParameters searchParameters xsi:type=NetworkSearchParameter networkSetting targetGoogleSearch xmlns=https://adwords.google.com/api/adwords/cm/v201309;true/targetGoogleSearch targetSearchNetwork xmlns=https://adwords.google.com/api/adwords/cm/v201309;false/targetSearchNetwork targetContentNetwork xmlns=https://adwords.google.com/api/adwords/cm/v201309;false/targetContentNetwork targetPartnerSearchNetwork xmlns=https://adwords.google.com/api/adwords/cm/v201309;false/targetPartnerSearchNetwork /networkSetting /searchParameters ideaTypeKEYWORD/ideaType requestTypeSTATS/requestType requestedAttributeTypesKEYWORD_TEXT/requestedAttributeTypes requestedAttributeTypesSEARCH_VOLUME/requestedAttributeTypes requestedAttributeTypesTARGETED_MONTHLY_SEARCHES/requestedAttributeTypes requestedAttributeTypesCOMPETITION/requestedAttributeTypes requestedAttributeTypesEXTRACTED_FROM_WEBPAGE/requestedAttributeTypes paging startIndex xmlns=https://adwords.google.com/api/adwords/cm/v201309;0/startIndex numberResults xmlns=https://adwords.google.com/api/adwords/cm/v201309;500/numberResults /paging /selector /get /soap:Body /soap:Envelope *Response* soap:Envelope xmlns:soap=http://schemas.xmlsoap.org/soap/envelope/; soap:Header ResponseHeader xmlns:ns2=https://adwords.google.com/api/adwords/cm/v201309; xmlns=https://adwords.google.com/api/adwords/o/v201309; ns2:requestId0004ec4ddfb9a0a00aded6870e78/ns2:requestId ns2:serviceNameTargetingIdeaService/ns2:serviceName ns2:methodNameget/ns2:methodName ns2:operations0/ns2:operations ns2:responseTime410/ns2:responseTime /ResponseHeader /soap:Header soap:Body getResponse xmlns:ns2=https://adwords.google.com/api/adwords/cm/v201309; xmlns=https://adwords.google.com/api/adwords/o/v201309; rval totalNumEntries1/totalNumEntries entries data keyKEYWORD_TEXT/key value xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:type=StringAttribute Attribute.TypeStringAttribute/Attribute.Type valueholiday kephalona greece/value /value /data /entries /rval /getResponse /soap:Body /soap:Envelope On Friday, November 29, 2013 6:45:43 AM UTC, Takeshi Hagikura (AdWords API Team) wrote: Hi everyone, Thanks for the report. Just to make sure, is it still reproducible? I tried the following request and I got the monthly values (12 values) for each keyword. ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; soapenv:Header ns1:RequestHeader soapenv:actor= http://schemas.xmlsoap.org/soap/actor/next; soapenv:mustUnderstand=0 xmlns:ns1=https://adwords.google.com/api/adwords/o/v201309; ns2:authToken xmlns:ns2= https://adwords.google.com/api/adwords/cm/v201309;**/ns2:authToken ns3:clientCustomerId xmlns:ns3= https://adwords.google.com/api/adwords/cm/v201309;** /ns3:clientCustomerId
Re: Missing TARGETED_MONTHLY_SEARCHES from response
Hi Takeshi Just had a closer look at your request you are doing requestTypeIDEAS/requestType but I am doing requestTypeSTATS/requestType I am doing STATS because I want stats for given keyword IDEAS will return other related similar keywords with their stats so the 12 months volumes you see are for some related keyword but not the actual one in request Thanks On Friday, November 29, 2013 6:45:43 AM UTC, Takeshi Hagikura (AdWords API Team) wrote: Hi everyone, Thanks for the report. Just to make sure, is it still reproducible? I tried the following request and I got the monthly values (12 values) for each keyword. ?xml version=1.0 encoding=UTF-8? soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi= http://www.w3.org/2001/XMLSchema-instance; soapenv:Header ns1:RequestHeader soapenv:actor= http://schemas.xmlsoap.org/soap/actor/next; soapenv:mustUnderstand=0 xmlns:ns1=https://adwords.google.com/api/adwords/o/v201309; ns2:authToken xmlns:ns2= https://adwords.google.com/api/adwords/cm/v201309;**/ns2:authToken ns3:clientCustomerId xmlns:ns3= https://adwords.google.com/api/adwords/cm/v201309;** /ns3:clientCustomerId ns4:developerToken xmlns:ns4= https://adwords.google.com/api/adwords/cm/v201309 ***/ns4:developerToken ns5:userAgent xmlns:ns5= https://adwords.google.com/api/adwords/cm/v201309;user agent/ns5:userAgent ns6:validateOnly xmlns:ns6= https://adwords.google.com/api/adwords/cm/v201309 false/ns6:validateOnly ns7:partialFailure xmlns:ns7= https://adwords.google.com/api/adwords/cm/v201309 false/ns7:partialFailure /ns1:RequestHeader /soapenv:Header soapenv:Body get xmlns=https://adwords.google.com/api/adwords/o/v201309; selector searchParameters xsi:type=ns8:RelatedToQuerySearchParameter xmlns:ns8=https://adwords.google.com/api/adwords/o/v201309; queriesholiday kephalona greece/queries /searchParameters searchParameters xsi:type=ns9:LocationSearchParameter xmlns:ns9=https://adwords.google.com/api/adwords/o/v201309; locations ns10:id xmlns:ns10= https://adwords.google.com/api/adwords/cm/v201309;2826/ns10:id /locations /searchParameters searchParameters xsi:type=ns11:NetworkSearchParameter xmlns:ns11=https://adwords.google.com/api/adwords/o/v201309; networkSetting ns12:targetGoogleSearch xmlns:ns12= https://adwords.google.com/api/adwords/cm/v201309 true/ns12:targetGoogleSearch ns13:targetSearchNetwork xmlns:ns13= https://adwords.google.com/api/adwords/cm/v201309 false/ns13:targetSearchNetwork ns14:targetContentNetwork xmlns:ns14= https://adwords.google.com/api/adwords/cm/v201309 false/ns14:targetContentNetwork ns15:targetPartnerSearchNetwork xmlns:ns15= https://adwords.google.com/api/adwords/cm/v201309 false/ns15:targetPartnerSearchNetwork /networkSetting /searchParameters ideaTypeKEYWORD/ideaType requestTypeIDEAS/requestType requestedAttributeTypesKEYWORD_TEXT/requestedAttributeTypes requestedAttributeTypesSEARCH_VOLUME/requestedAttributeTypes requestedAttributeTypesTARGETED_MONTHLY_SEARCHES/requestedAttributeTypes requestedAttributeTypesCOMPETITION/requestedAttributeTypes requestedAttributeTypesEXTRACTED_FROM_WEBPAGE/requestedAttributeTypes paging ns16:startIndex xmlns:ns16= https://adwords.google.com/api/adwords/cm/v201309;0/ns16:startIndex ns17:numberResults xmlns:ns17= https://adwords.google.com/api/adwords/cm/v201309;10/ns17:numberResults /paging /selector /get /soapenv:Body /soapenv:Envelope Best, - Takeshi, AdWords API Team On Thursday, November 28, 2013 9:24:18 PM UTC+9, PPC London wrote: Thanks Marius Good to know that it is not just us. On Thursday, November 28, 2013 11:46:24 AM UTC, Marius-Eugen Gerdan wrote: you are not alone. we also have this issue. it seems to have to do with some keywords in the call. if you split the calls into multiple calls with only one keyword, this works, only the keywords included, that have no search volume will be affected. this is clearly a bug. please fix this urgent. Am Donnerstag, 28. November 2013 11:01:25 UTC+1 schrieb PPC London: Is it just us, or anyone else also seen this behavior? Its urgent please... On Wednesday, November 27, 2013 12:07:16 PM UTC, PPC London wrote: Even SEARCH_VOLUME and COMPETITION are missing from response -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to
How do I set custom date range when downloading reports using adwords API PHP client library.
I am using adwords PHP client library for my application. I want to to download reports for a custom date range and do not know the right parameters used to set the dates. Following is the code I'm currently using: $reportFileName = DS . 'AdPerformanceReport_dated.csv'; $reportType = 'AD_PERFORMANCE_REPORT'; $filePath = dirname(__FILE__) . $reportFileName; $user = new AdWordsUser(); $user-LogAll(); $user-SetClientCustomerId($adwordClientId); $user-LoadService('ReportDefinitionService', ADWORDS_VERSION); $selector = new Selector(); $selector-fields = $reportFields[$reportType]; // Create report definition. $reportDefinition = new ReportDefinition(); $reportDefinition-selector= $selector; $reportDefinition-reportName = 'Ad performance report'; $reportDefinition-dateRangeType = 'CUSTOM_DATE'; $reportDefinition-reportType= $reportType; $reportDefinition-downloadFormat = 'CSV'; $reportDefinition-includeZeroImpressions = FALSE; $options = array('version' = ADWORDS_VERSION); // Download report. ReportUtils::DownloadReport($reportDefinition, $filePath, $user, $options); I hope someone can tell me what are the right parameters to set dates. -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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.
what the problem ???? [AdError.INVALID_AD_TYPE @ operations[0].operand.ad] . Thanks!
my script Php ?php // Reference to the service and version of the API you want to use require_once 'src/Google/Api/Ads/AdWords/v201306/AdGroupAdService.php'; ini_set('display_errors', 1);ini_set('log_errors', 1); define(ADWORDS_API_VERSION, v201306); // Production API //define(ADWORDS_API_SERVER, https://adwords.google.com;); // Sandbox API define(ADWORDS_API_SERVER, https://adwords.google.com;); define(ADWORDS_API_NAMESPACE, https://adwords.google.com/api/adwords/cm/; . ADWORDS_API_VERSION); define(ADWORDS_API_CAMPAIGN_SERVICE, ADWORDS_API_SERVER . /api/adwords/cm/ . ADWORDS_API_VERSION . /AdGroupAdService); // Your API Developer Token define(ADWORDS_API_TOKEN, ffrTN5H-**NvsZiA); // The account that you want to download performace data from $username = t...@gmail.com; $password = )); $customerId = 576-***-3559; try { // Get an auth token for the user $url = https://www.google.com/accounts/ClientLogin;; $params = array( accountType = GOOGLE, Email = $username, Passwd = $password, service = adwords, source = test ); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $params); curl_setopt($curl, CURLOPT_ENCODING, ); $curlData = curl_exec($curl); curl_close($curl); $pos = strpos($curlData, Auth=); if ($pos -1) { $auth = trim(substr($curlData, $pos + 5)); } else { throw new Exception(You haven't supplied a valid username or password for an existing Google account.); } // Create the headers needed to access the API $headers = array( developerToken = ADWORDS_API_TOKEN, userAgent = agence, clientCustomerId = $customerId, authToken = $auth ); // Encode the headers $encodedHeaders = new SoapHeader(ADWORDS_API_NAMESPACE, RequestHeader, $headers, false); $options = array( 'features' = SOAP_SINGLE_ELEMENT_ARRAYS, 'encoding' = 'utf-8'); // Create the SOAP client $client = new SoapClient(ADWORDS_API_CAMPAIGN_SERVICE . ?wsdl, $options); $client-__setSoapHeaders($encodedHeaders); // print_r($client); echo ADWORDS_API_CAMPAIGN_SERVICE . ?wsdl; var_dump($client-__getFunctions()); $adGroupId = '8424820921'; $numAds = 5; $operations = array(); // for ($i = 0; $i $numAds; $i++) { // Create text ad. $textAd = new TextAd(); $textAd-headline = 'Cruise'; $textAd-description1 = 'Visit'; $textAd-description2 = 'Low-gravity'; $textAd-displayUrl = 'www.example.com'; $textAd-url = 'http://www.example.com'; $textAd-AdType = TextAd; // Create ad group ad. $adGroupAd = new AdGroupAd(); $adGroupAd-adGroupId = $adGroupId; $adGroupAd-ad = $textAd; // Set additional settings (optional). $adGroupAd-status = 'PAUSED'; // Create operation. $operation = new AdGroupAdOperation(); $operation-operand = $adGroupAd; $operation-operator = 'ADD'; $operations[] = $operation; // } // Make the mutate request. $result = $client-mutate($operations); // Display results. foreach ($result-value as $adGroupAd) { printf(Text ad with headline '%s' and ID '%s' was added.\n, $adGroupAd-ad-headline, $adGroupAd-ad-id); } } catch (Exception $e) { print_r($e); if (isset($client)) { print $client-__getLastRequest() . \n; print $client-__getLastResponse() . \n; } } reponse: Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /var/www/vhosts/httpdocs/adwords_api_php_4.6.1/autreesai.php on line 40https://adwords.google.com/api/adwords/cm/v201306/AdGroupAdService?wsdlarray(3) { [0]= string(32) getResponse get(get $parameters) [1]= string(41) mutateResponse mutate(mutate $parameters) [2]= string(38) queryResponse query(query $parameters)}SoapFault Object([message:protected] = [AdError.INVALID_AD_TYPE @ operations[0].operand.ad] [string:Exception:private] = [code:protected] = 0[file:protected] = /var/www/vhosts/httpdocs/adwords_api_php_4.6.1/autreesai.php [line:protected] = 122[trace:Exception:private] = Array( [0] = Array([file] = /var/www/vhosts/httpdocs/adwords_api_php_4.6.1/autreesai.php [line] = 122[function] = __call [class] = SoapClient[type] = -[args] = Array([0] = mutate
OAuth2Exception with message 'Couldn't resolve host 'accounts.google.com'
Our server-based reports are failing with a new error message: PHP Fatal error: Uncaught exception 'OAuth2Exception' with message 'Couldn't resolve host 'accounts.google.com'' in /var/www/m_prod/adwords_api_php_4.5.1/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php:112 Stack trace: #0 /var/www/m_prod/adwords_api_php_4.5.1/src/Google/Api/Ads/Common/Util/SimpleOAuth2Handler.php(92): SimpleOAuth2Handler-MakeRequest('https://account...', Array) #1 /var/www/m_prod/batch_/libBatch_api.php(230): SimpleOAuth2Handler-RefreshAccessToken(Array) ... We are relying on the Adwords library for oauth2 services. We modified slightly to support server-to-server (no browser interaction). It was working fine until earlier this month. Any help in resolving this would be appreciated. -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://googleadsdeveloper.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.