@kevin >> sandbox account initialization logic didn't properly initialize accounts (and assigned them zeros).

544 views
Skip to first unread message

Sander

unread,
Jul 25, 2012, 4:56:51 PM7/25/12
to adwor...@googlegroups.com
Hello Kevin,

I took my problem out of the running topic on https://groups.google.com/forum/?fromgroups#!topic/adwords-api/RuzzccFvpE8 to avoid confusion and because that discussion is flagged as answered.


I just made a brand new account, but have the same result with zeros :

My code:

$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com/"); 
$user->SetClientId(null);

$campaignService = $user->GetService('CampaignService', 'v201109_1');
// Create selector.
$selector = new Selector();
$selector->fields = array('Id', 'Name');
$selector->ordering[] = new OrderBy('Name', 'ASCENDING');
// Create paging controls.
$selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);
do {
// Make the get request.
$page = $campaignService->get($selector);
// Display results.
if (isset($page->entries)) {
foreach ($page->entries as $campaign) {
printf("Campaign with name '%s' and id '%s' was found.\n",
$campaign->name, $campaign->id);
}
} else {
print "No campaigns were found.\n";
}
// Advance the paging index.
$selector->paging->startIndex += AdWordsConstants::RECOMMENDED_PAGE_SIZE;
} while ($page->totalNumEntries > $selector->paging->startIndex);


     $campaignService = $user->GetService('CampaignService', 'v201109');
   $customerSyncService = $user->GetService('CustomerSyncService', 'v201109');
  
   $accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
echo "<PRE>";
print_r($page);
foreach ($page->accounts as $account) {
print "Customer ID: {$account->customerId}\n";
}

Resulting in:

No campaigns were found.
ServicedAccountGraph Object
(
    [accounts] => Array
        (
            [0] => Account Object
                (
                    [customerId] => 0
                    [login] => client_1+testapisandbox@gmail.com
                    [companyName] => 
                    [canManageClients] => 
                    [currencyCode] => 
                    [dateTimeZone] => 
                )

            [1] => Account Object
                (
                    [customerId] => 0
                    [login] => client_2+testapisandbox@gmail.com
[companyName] => [canManageClients] => [currencyCode] => [dateTimeZone] => )

Am I in the wrong ?

vaco sandbox

unread,
Jul 26, 2012, 5:49:06 AM7/26/12
to adwor...@googlegroups.com
i have also this problem... just created new MCC account 1h ago and all i got was [customerId] => 0 for all 5 accounts.

Anash P. Oommen

unread,
Jul 26, 2012, 9:41:56 AM7/26/12
to adwor...@googlegroups.com
Hi,

I've reported this issue to the engineering team, I'll update this thread once I hear from them.

Cheers,
Anash P. Oommen,
AdWords API Advisor.

Haixiao Yang

unread,
Jul 26, 2012, 6:07:57 PM7/26/12
to adwor...@googlegroups.com
The problem is still exist. Can this problem be fixed within this week??

在 2012年7月26日星期四UTC-7上午6时41分56秒,Anash P. Oommen写道:

vlado vaco

unread,
Jul 29, 2012, 3:20:43 PM7/29/12
to adwor...@googlegroups.com
Hello,

any updates about this issue?

thank you for response
best regards

Sage Lewis

unread,
Jul 30, 2012, 6:49:05 PM7/30/12
to adwor...@googlegroups.com
For the record, I believe this is my issue too. 

I'm using Ewan Heming's sandbox script and am getting this error:

Customer ID: 0 Customer ID: 0 Customer ID: 0 Customer ID: 0 Customer ID: 0 
Fatal error: Uncaught SoapFault exception: [soap:Server] [AuthorizationError.USER_PERMISSION_DENIED @ ] in /home/sagerock/public_html/AdWordsAPI/Google/Api/Ads/Common/Lib/AdsSoapClient.php:201 Stack trace: #0 /home/sagerock/public_html/AdWordsAPI/Google/Api/Ads/Common/Lib/AdsSoapClient.php(201): SoapClient->__soapCall('mutate', Array, NULL, Array, Array) #1 /home/sagerock/public_html/AdWordsAPI/Google/Api/Ads/AdWords/v201109/CampaignService.php(5728): AdsSoapClient->__soapCall('mutate', Array) #2 /home/sagerock/public_html/AdWordsAPI/sandbox2.php(53): CampaignService->mutate(Array) #3 {main} thrown in /home/sagerock/public_html/AdWordsAPI/Google/Api/Ads/Common/Lib/AdsSoapClient.php on line 201

I've tried a variety of Google accounts. 

When I put in the wrong credentials it gives me that error instead. So it appears I'm making a connection to the server.

Thanks for your help!

vlado vaco

unread,
Jul 31, 2012, 4:32:15 AM7/31/12
to adwor...@googlegroups.com
Hello,

any updates in this issue please?

Cheers,
Vaco

On Thursday, July 26, 2012 3:41:56 PM UTC+2, Anash P. Oommen wrote:

Elisaveta Manusheva

unread,
Aug 2, 2012, 3:53:03 AM8/2/12
to adwor...@googlegroups.com
Whats the progress on this issue? Its been a week now with no changes - could you please advise when we could expect a fix to this problem. Thank you for your reply in advance. 

Best,

Ely
Message has been deleted

Yulong Yang

unread,
Aug 7, 2012, 3:01:01 PM8/7/12
to adwor...@googlegroups.com
I am stuck in this problem too. Now I have 5 client account with id = 0. When I use 0 as id in for example use_auth.py, it returns USER_PERMISSION_DENIED error.

Michael Roterman

unread,
Aug 9, 2012, 3:32:15 AM8/9/12
to adwor...@googlegroups.com
Hi Anash,

Can you please update this topic? I am having the same problems like the rest in here.

Michael R.

vlado vaco

unread,
Aug 10, 2012, 6:14:43 AM8/10/12
to adwor...@googlegroups.com
Hello,

any updates? Please, just say something, so we know what to expect...


On Wednesday, July 25, 2012 10:56:51 PM UTC+2, Sander wrote:
No campaigns were found.
ServicedAccountGraph Object
(
    [accounts] => Array
        (
            [0] => Account Object
                (
                    [customerId] => 0
                    [login] => client_1+te...@gmail.com
                    [companyName] => 
                    [canManageClients] => 
                    [currencyCode] => 
                    [dateTimeZone] => 
                )

            [1] => Account Object
                (
                    [customerId] => 0
                    [login] => client_2+te...@gmail.com
[companyName] => [canManageClients] => [currencyCode] => [dateTimeZone] => )

HotelASP

unread,
Aug 10, 2012, 3:55:48 PM8/10/12
to adwor...@googlegroups.com
Hello,
 
We are having the same problem. All five customersID are equal to 0.
 
We are using the c# .NET library and executed the GetCampaigns and after GetAccountHierarchy, exactly as explained in several places.
 
 We tried using 5 different google accounts, we tried v201109, v201109_1 and v201206.   We tried everything. No success.
 
Please help.
 
HotelASP Team

James Scott

unread,
Aug 11, 2012, 6:09:26 AM8/11/12
to adwor...@googlegroups.com


On Wednesday, July 25, 2012 10:56:51 PM UTC+2, Sander wrote:
No campaigns were found.
ServicedAccountGraph Object
(
    [accounts] => Array
        (
            [0] => Account Object
                (
                    [customerId] => 0
                    [login] => client_1+te...@gmail.com
                    [companyName] => 
                    [canManageClients] => 
                    [currencyCode] => 
                    [dateTimeZone] => 
                )

            [1] => Account Object
                (
                    [customerId] => 0
                    [login] => client_2+te...@gmail.com
[companyName] => [canManageClients] => [currencyCode] => [dateTimeZone] => )

Kevin Winter

unread,
Aug 13, 2012, 11:44:51 AM8/13/12
to adwor...@googlegroups.com
Hi all,
  We apologize for this inconvenience.  We're working on implementing and testing a fix that we hope to roll out in the coming week or two.

- Kevin Winter
AdWords API Team

Goran Jakovljevic

unread,
Aug 20, 2012, 10:19:54 AM8/20/12
to adwor...@googlegroups.com
Just a quick question as ive started working with Google API today and couldnt get any data, keep getting  " Customer ID: 7512789598 Customer ID: 5743374498 Customer ID: 4011561396 Customer ID: 5409744600 Customer ID: 3101657547 No matching campaigns were found. " as i am going through sandbox I suppose that I am having same problem as everyone else ? If someone can confirm this so that i dont lose time trying to fix it. 

Here is also the code:

<?php
 
require_once '../src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
 
$username = "*********"; 
$password = "******";
$currencyCode = "******";
$developerToken = "************";
 
$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com/");
$user->LogAll();
$user->SetClientId(null);
 
try {
    $campaignService = $user->GetService("CampaignService", 'v201109');
    $page = $campaignService->get(new Selector());
} catch (Exception $e) {}
 
$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
foreach ($page->accounts as $account) {
    print "Customer ID: {$account->customerId}\n";
}
 
$customerId = $page->accounts[0]->customerId;
$user->SetClientId($customerId);
 
$campaignService = $user->GetService("CampaignService", 'v201109');
 
$campaign = new Campaign();
$campaign->name = "Test Sandbox Account #" + time();
$campaign->status = "ACTIVE";
$campaign->biddingStrategy = new ManualCPC();
 
$budget = new Budget();
$budget->period = 'DAILY';
$budget->amount = new Money((float) 10000000);
$budget->deliveryMethod = 'STANDARD';
$campaign->budget = $budget;
 
$networkSetting = new NetworkSetting();
$networkSetting->targetGoogleSearch = TRUE;
$campaign->networkSetting = $networkSetting;
 
$operation = new CampaignOperation();
$operation->operand = $campaign;
$operation->operator = 'ADD';
 
$operations = array($operation);
$result = $campaignService->mutate($operations);

//echo $result->value[0]->id;
//print_r($result);

//exit;


try {

$campaignService = $user->GetService('CampaignService', 'v201109');
// Create selector.
  $selector = new Selector();
  $selector->fields =
      array('Id', 'Name', 'Impressions', 'Clicks', 'Cost', 'Ctr');
  $selector->predicates[] =
      new Predicate('Impressions', 'GREATER_THAN', array(0));

  // Set date range to request stats for.
  $dateRange = new DateRange();
  $dateRange->min = date('Ymd', strtotime('-1 week'));
  $dateRange->max = date('Ymd', strtotime('-1 day'));
  $selector->dateRange = $dateRange;
  
  $campaignId = '';

// Create selector.
//$selector->ids = array($result->value[0]->id);

  // Create paging controls.
  $selector->paging = new Paging(0, AdWordsConstants::RECOMMENDED_PAGE_SIZE);

  do {
    // Make the get request.
    $page = $campaignService->get($selector);
//print_r($page);

    // Display results.
    if (isset($page->entries)) {
      foreach ($page->entries as $campaign) {
        printf("Campaign with name '%s' and id '%s' had the following stats "
            . "during the last week:\n", $campaign->name, $campaign->id);
        printf("  Impressions: %d\n", $campaign->campaignStats->impressions);
        printf("  Clicks: %d\n", $campaign->campaignStats->clicks);
        printf("  Cost: $%.2f\n", $campaign->campaignStats->cost->microAmount
            / AdWordsConstants::MICROS_PER_DOLLAR);
        printf("  CTR: %.2f%%\n", $campaign->campaignStats->ctr * 100);
      }
    } else {
      print "No matching campaigns were found.\n";

Kevin Winter

unread,
Aug 21, 2012, 9:33:50 AM8/21/12
to adwor...@googlegroups.com
Hi,
  We just pushed out a fix for this bug.  Please create a new sandbox account and try again.

- Kevin Winter
AdWords API Team

Kevin Winter

unread,
Aug 21, 2012, 9:35:23 AM8/21/12
to adwor...@googlegroups.com
Hi,
  Could you please clarify what calls you are making with the API?  If you follow the Getting Started with the Sandbox mini-guide, it will have you Add some campaigns and then Get them to verify your account has data.  A brand-new sandbox account won't have any data in it.

- Kevin Winter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages