ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH

111 views
Skip to first unread message

goo...@gruener-fisher.de

unread,
Jan 18, 2016, 8:13:39 AM1/18/16
to AdWords API Forum
We created an API which creates an AD_PERFORMANCE_REPORT for the last day in XML format. Running it with the token with our test-account, everything works as it should. So today our token got approved for the acctual account (Login is MCC).
So we changed the Login data accordingly in the app.config. So login works all OK, but when it tries to get the report we now get the following error:

"Customer can not create report of a selected type.. (Error: ReportDefinitionError.CUSTOMER_SERVING_TYPE_REPORT_MISMATCH, FieldPath: selector, Trigger: )"

So what does this mean, and how can this be fixed?

Here is the code we are running:

public static XmlDocument GetReport(AdWordsUser user, string fileName = "")
        {
            ReportDefinition definition = new ReportDefinition()
            {
                reportName = "AD_PERFORMANCE_REPORT",
                reportType = ReportDefinitionReportType.AD_PERFORMANCE_REPORT,
                downloadFormat = DownloadFormat.XML,
                dateRangeType = ReportDefinitionDateRangeType.YESTERDAY,

                selector = new Selector()
                {
                    fields = new string[] { "Id", "Headline", "Description1", "Description2", "DisplayUrl", "Impressions", "Clicks", "Cost", "Ctr", "Status" },
                    predicates = new Predicate[] { Predicate.In("Status", new string[] { "ENABLED", "PAUSED", "DISABLED" }) }
                },

                // Optional: Include zero impression rows.
                includeZeroImpressions = true
            };

            try
            {
                ReportUtilities utilities = new ReportUtilities(user, "v201509", definition);
                XmlDocument doc = new XmlDocument();
               
                using (ReportResponse response = utilities.GetResponse())
                {
                    if (fileName != "")
                    {
                        string filePath = Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData) + @"\Temp\" + fileName;
                        response.Save(filePath);
                    }
                    else
                    {
                        StreamReader stream = new StreamReader(response.Stream);
                        doc.PreserveWhitespace = true;
                        doc.Load(stream);
                    }
                }

                return doc;
            }
            catch (Exception ex)
            {
                FileLogger.HandleError("", false, true, "Error (ReportHandle, GetReport): " + Environment.NewLine + ex.Message, App._LogFilePath, App._LogFileName);
                return null;
            }
        }

Since the code works on the Test account, It can't really be some code error. So it must be with the Google token access. Do we need to apply for more access???

Any help appreciated.

goo...@gruener-fisher.de

unread,
Jan 18, 2016, 10:26:20 AM1/18/16
to AdWords API Forum
OK, we solved it. In case someone else has same problem. The accountnumber passed to create the Reports for, can't be a MCC account number!

Thanet Knack Praneenararat (AdWords API Team)

unread,
Jan 19, 2016, 1:26:53 AM1/19/16
to AdWords API Forum
Hello,

Thanks so much for sharing your issue and solution.
Yes, reports should be requested using a non-MCC account number.

Best,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages