Can't find the campaign I created.

62 views
Skip to first unread message

YuK1

unread,
Aug 5, 2020, 7:38:21 AM8/5/20
to AdWords API and Google Ads API Forum
I have created an MCC Test account and two child accounts.
We created a video campaign for each of those two accounts.

----------------

MCC Test Account ... ID: 000-0000-000
    Campaign Account 1 ... ID: 111-1111-111
        Movie Campaign
    Campaign Account 2 ... ID: 222-2222-222
        Movie Campaign

----------------

I issued the following query and
I tried to get a campaign for a child account in PHP.


$query = 'SELECT campaign.id FROM campaign';

$response = $client->search(0000000000, $query);

foreach ($response->iterateAllElements() as $googleAdsRow) {
    /** @var GoogleAdsRow $googleAdsRow */
    printf(
        "Ad group with ID %d and name '%s' was found in campaign with ID %d.%s",
        $googleAdsRow->getAdGroup()->getId()->getValue(),
        $googleAdsRow->getAdGroup()->getName()->getValue(),
        $googleAdsRow->getCampaign()->getId()->getValue(),
        PHP_EOL
    );
}

But nothing appears.

Is there a special way to get a campaign for a child account?

Thanks.

Google Ads API Forum Advisor Prod

unread,
Aug 5, 2020, 1:05:48 PM8/5/20
to ras...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to us. I see that you're having issues getting your campaign data from campaign reports in Google Ads API. Could you check that you're making the query in the campaign account and not the manager account? Manager accounts manage campaign accounts, and campaign accounts manage campaigns/ads/adgroups, which means if you're querying in the Manager Account level, you won't get a response from campaign reports as they don't manage campaigns. Let me know if you have further questions.

Thank you,
Bryan, Google Ads API Team

ref:_00D1U1174p._5004Q23Hl3G:ref

三浦壮登

unread,
Sep 10, 2020, 5:47:49 AM9/10/20
to AdWords API and Google Ads API Forum

Hello. 

 I am suffering from the same problem. 
 It says to execute a query with a campaign account. Can you give me a concrete example? 

 Thank you
2020年8月6日木曜日 2:05:48 UTC+9 adsapiforumadvisor:

Google Ads API Forum Advisor Prod

unread,
Sep 10, 2020, 2:01:04 PM9/10/20
to miuram...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to us. You can follow this example to pull campaign data. If you're still experiencing problems, could you provide me with your request and response logs for where you encounter this error?

Thank you,

Google Logo
Bryan Li
Google Ads API Team
 


ref:_00D1U1174p._5004Q23Hl3G:ref

三浦壮登

unread,
Sep 10, 2020, 7:01:56 PM9/10/20
to AdWords API and Google Ads API Forum

Thank you for your reply.

I have created some campaigns with a test account, but I can't get the campaigns even after running the sample.

In addition, MCC account information can be obtained.

The response log when acquiring the campaign is as follows.


response:

[2020-09-10T09:41:14.512250+00:00] google-ads.INFO: Request made: Host: "googleads.googleapis.com", Method: "/google.ads.googleads.v5.services.GoogleAdsService/Search", CustomerId: xxx, RequestId: "e8YHKNUtRGyPZOcS6kl3ag", IsFault: 0, FaultMessage: "None"


It doesn't seem to be an error, but I'm not sure what's wrong.

Is there any other information I need?


Thanking you in advance.


2020年9月11日金曜日 3:01:04 UTC+9 adsapiforumadvisor:

Google Ads API Forum Advisor Prod

unread,
Sep 11, 2020, 11:58:20 AM9/11/20
to miuram...@gmail.com, adwor...@googlegroups.com
Hi,

Could you confirm with me if you've set the Customer Client ID as your MCC account ID? If so, you won't get any data since you're not able to pull campaign data from your MCC account. Your MCC account manages customer client accounts, and those customer client accounts manage campaigns and ads. Therefore, you'll need to set your customer client ID as the CCID in your request in order to pull data.

If not, could you provide me with the customer client ID number from which you're trying to pull campaign data from?
Reply all
Reply to author
Forward
0 new messages