Search code examples
google-apigoogle-api-dotnet-clientdouble-click-advertising

Scopes required for Google DoubleClick Search API


For the ReportScopes in the Google DoubleClick Search API, the documentation states that for a n-level scope, it's lower scoped id's must be non-empty.

https://developers.google.com/doubleclick-search/v2/reference/reports#request.reportScope

So if I select KeywordId, then AdId must also be non-empty. However, when I make the actual API call for report types of "account", "advertiser", and "ad", I get a reportScope exception if I fill out all the scopes as required by the documentation. However, when I fill out only AgencyId, AdvertiserId (and filling out EngineAccountId also works), I get a report back.

What I want to know is what combination of scopes are required for each report type? I am unable to find it anywhere in the documentation.


Solution

  • From the DoubleClick Search team


    I’ve looked into the article that you’ve shared and all the scopes mentioned under report scope is just for an example. It’s not mandatory that all the scopes are required for all kinds of reports.

    The combination of scopes required when running an API report is the same combination of scopes (the top navigation bar) which are required when navigating to various objects in DS UI.

    For example, if you’d like to navigate to an engine accounts tab in DS UI, you navigate to the agency and then to an advertiser and you’ll be able to view data for all the engine accounts under it. However if you also select an engine account, you wouldn’t be able to see the engine accounts tab. The top most (according to the hierarchy) tab you’ll then be able to select will be campaigns tab.

    So engine account or any lower level object (campaign, ad group, keyword, ad) can’t be selected in the scope when you’re pulling a account level report. However you can filter for certain accounts in the account type report.

    In account level report (report type account), you’ll only be able to specify the scope until advertiser ID. In advertiser level report, you’ll be able to specify only the agency ID. In ad type report, you need to specify scope until the ad group ID.

    Here’s how the hierarchy goes in DS:

    • Agency • Advertiser • Account • Campaign • Ad group • Keyword / Ad

    For campaign type report, you can only specify Advertiser ID and Account ID. For Ad group type report, you can only specify Advertiser ID, Account ID and Campaign ID.

    So the combination of scope required in reporting API is same as that required in the DS UI.