Facing CUSTOMER_SERVING_TYPE_REPORT_MISMATCH though sending not MCC account but adwords client account id

89 views
Skip to first unread message

Алексей Хан

unread,
Oct 11, 2017, 8:49:27 AM10/11/17
to AdWords API Forum
Hello!

I'm dealing with a big problem.

I've created a test MCC account to get an access to API, created several test clients account:

MCC / Test AdWords API (533-433-6839) >
CLIENT / > Test Client Account 1 (264-130-2396)
CLIENT / > Test Client Account 2 (117-541-4601)

Now, when I'm trying to get a report (ACCOUNT_PERFORMANCE_REPORT), after checking whether account is not MCC, I'm still getting this error:

"Details: [fieldPath: selector.reportDefinition; trigger: ; errorString: ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH]"

Here's my code:

if (! $managedCustomer->getCanManageClients()) {

// --> Checked 100 times: this code works only when ManagedCustomer object's getCanManageClients() getter returns FALSE

$reportSession = (new AdWordsSessionBuilder())
    ->withOAuth2Credential($oauth2)
    ->withDeveloperToken(env('ADWORDS_DEVELOPER_TOKEN'))
    ->withClientCustomerId($_managedCustomer->customer_id)  
    ->build();

// --> No matter which clientCustomerId is mentioned, i've tried all of them hardcoded - none of them works (2641302396, 1175414601)

... ... ... 

                    $reportTemporaryFilePath = sprintf(
                        '%s.csv',
                        tempnam(sys_get_temp_dir(), 'report-')
                    );

                    $selector = new Selector();

                    $selector->setFields([
                        'Cost',                    
                        'Conversions',            
                        'CostPerAllConversion',     
                        'Impressions',              
                        'AverageCpm',              
                        'Ctr',                     
                        'Clicks',                  
                        'AverageCpc',              
                        'ConversionRate',         
                        'InvalidClicks',           
                        'InvalidClickRate',     
                    ]);

                    $reportDefinition = new ReportDefinition();

                    $reportDefinition->setSelector($selector);

                    $reportDefinition->setReportType(
                        ReportDefinitionReportType::ACCOUNT_PERFORMANCE_REPORT);

                    $reportDefinition->setReportName(
                        'AAPR_' . uniqid()); // Adwords Account Performance Report

                    $reportDefinition->setDateRangeType(
                        ReportDefinitionDateRangeType::TODAY);

                    $reportDefinition->setDownloadFormat(DownloadFormat::CSV);

                    $reportDownloader = new ReportDownloader($session);

... ... ...

$reportDownloadResult = $reportDownloader->downloadReport($reportDefinition);  // --> Here I'm getting this error

}

What's the problem? 

How can I solve it?

Jude Amagoh

unread,
Oct 11, 2017, 3:27:42 PM10/11/17
to AdWords API Forum
Hi,

This problem occurs when you are trying to run a report against a manager account. In order for me troubleshoot this problem, I'll have to gather more information about this issue. If possible could you enable logging and provide the soap request and response logs so I can take a look?

Best Regards,
Jude, Adwords API Team
Reply all
Reply to author
Forward
0 new messages