[Google Ads API] GAQL query selecting from ad_group_criterion_simulation only works for some accounts, other accounts return empty result, no error - same accounts on Adwords API all work fine

315 views
Skip to first unread message

Robert Heise

unread,
May 9, 2019, 10:56:05 AM5/9/19
to AdWords API and Google Ads API Forum
Hello,

we're currently migrating from Adwords API to Ads API and stumbled on an issue when trying to fetch "Ad Group Criterion Simulation" data via GAQL query (formerly known as ad group criterion bid landscapes in Adwords API). In the Adwords API we're able to fetch data for all accounts. On the Ads API however when we try fetching data for small accounts, it works, but for larger accounts we only get an empty result. There is no error shown.

I'm trying to fetch using the Java client library, version 2.0.0 which has been just released a few days ago (https://mvnrepository.com/artifact/com.google.api-ads/google-ads/2.0.0). See sample code below (adapted from the provided java examples for ad_group_criterion_simulation source):

package com.foobar.google.ads;

import com.google.ads.googleads.lib.GoogleAdsClient;
import com.google.ads.googleads.v1.errors.GoogleAdsError;
import com.google.ads.googleads.v1.errors.GoogleAdsException;
import com.google.ads.googleads.v1.services.*;

import java.io.FileNotFoundException;
import java.io.IOException;

public class GetAdGroupCriterionSimulations {

   
private static final int PAGE_SIZE = 1_000;

   
public static void main(String[] args) {
       
long customerId = <CUSTOMER_ID>;

       
GoogleAdsClient googleAdsClient;
       
try {
            googleAdsClient
= GoogleAdsClient.newBuilder().fromPropertiesFile().build();
           
System.out.printf("Credentials: %s%n", googleAdsClient.getCredentials().toString());
       
} catch (FileNotFoundException fnfe) {
           
System.err.printf(
                   
"Failed to load GoogleAdsClient configuration from file. Exception: %s%n", fnfe);
           
return;
       
} catch (IOException ioe) {
           
System.err.printf("Failed to create GoogleAdsClient. Exception: %s%n", ioe);
           
return;
       
}

       
try {
           
new GetAdGroupCriterionSimulations().runExample(googleAdsClient, customerId);
       
} catch (GoogleAdsException gae) {
           
// GoogleAdsException is the base class for most exceptions thrown by an API request.
            // Instances of this exception have a message and a GoogleAdsFailure that contains a
            // collection of GoogleAdsErrors that indicate the underlying causes of the
            // GoogleAdsException.
            System.err.printf(
                   
"Request ID %s failed due to GoogleAdsException. Underlying errors:%n",
                   
gae.getRequestId());
           
int i = 0;
           
for (GoogleAdsError googleAdsError : gae.getGoogleAdsFailure().getErrorsList()) {
               
System.err.printf("  Error %d: %s%n", i++, googleAdsError);
           
}
       
}
   
}

   
/**
     * Runs the example.
     *
     * @param googleAdsClient the Google Ads API client.
     * @param customerId the client customer ID.
     * @throws GoogleAdsException if an API request failed with one or more service errors.
     */
    private void runExample(GoogleAdsClient googleAdsClient, long customerId) {
       
try (GoogleAdsServiceClient googleAdsServiceClient =
                     
googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {
            SearchGoogleAdsRequest request =
                   
SearchGoogleAdsRequest.newBuilder()
                           
.setCustomerId(Long.toString(customerId))
                           
.setPageSize(PAGE_SIZE)
                           
.setQuery("SELECT ad_group_criterion_simulation.ad_group_id, ad_group_criterion_simulation.criterion_id FROM ad_group_criterion_simulation")
                           
.build();
           
// Issues the search request.
            GoogleAdsServiceClient.SearchPagedResponse searchPagedResponse = googleAdsServiceClient.search(request);
           
// Iterates over all rows in all pages and prints the requested field values in each row.
            for (GoogleAdsRow googleAdsRow : searchPagedResponse.iterateAll()) {
               
System.out.printf(
                       
"Ad group criterion simulation cpc bid point for ad group %s and criterion %s.%n",
                        googleAdsRow
.getAdGroupCriterionSimulation().getAdGroupId().getValue(),
                        googleAdsRow
.getAdGroupCriterionSimulation().getCriterionId().getValue());
           
}
       
}
   
}
}
Enter code here...

I can send you concrete account IDs (aka customer IDs) in private. Note, that adding a LIMIT to the GAQL query doesn't help either, the result is still empty for larger accounts. Also note, that I can successfully access other information from the accounts (i.e. conversion_actions), only ad_group_criterion_simulation doesn't work (so far).

No idea whether the issue is really linked to the account size. Also no idea whether the java client lib is hiding the actual error (though so far it was raising other errors quite well) or it is a generic issue with the Google Ads API.

Please inspect the ad_group_criterion_simulation resource in the Google Ads API. It would be great if the issue could be resolved in the Ads API as this problem is blocking the migration from Adwords API to Ads API.

Regards,

Robert

googleadsapi...@google.com

unread,
May 9, 2019, 5:13:04 PM5/9/19
to AdWords API and Google Ads API Forum
Hello Robert,

Could you please share the account Ids for which you are getting empty results? Please use reply privately to the author option while sharing the client customer ids.

Regards,
Sai Teja, Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Robert Heise

unread,
May 10, 2019, 1:55:11 AM5/10/19
to AdWords API and Google Ads API Forum
Hello Sal Teja,

another discrepancy I noticed is, that via the Adwords API I'm receiving start & end date for the last 30 days for the ad group criterion bid landscapes, while the response from the Google Ads API contains last 7 days only (for the accounts that work). You can easily check this by adding ad_group_criterion_simulation.start_date and end_date to the GAQL query. This is also another discrepancy between the Adwords and Ads API. It would be great to align this behavior as well across the Adwords & Ads APIs. The start and end date can't be filtered for for this resource, we have to live with what Google provides as date range.

On Adwords API we noticed the change from 7 to 30 days only recently for this type of data. In the documentation the date range is still described as "a week": https://developers.google.com/adwords/api/docs/reference/v201809/DataService.BidLandscape . Ads API seems to follow this, Adwords API since recently doesn't...

Regards,

Robert

Robert Heise

unread,
May 20, 2019, 9:53:26 AM5/20/19
to AdWords API and Google Ads API Forum
Hello Sal Teja, hello Ben,

the behavior hasn't changed, the query in the sample code above still only returns data for some accounts - for other accounts I'm getting an empty response, no errors. The Adwords API returns thousands and thousands of rows for the same accounts.

Can you confirm the issue and do you have any update when this issue will be fixed in the Google Ads API?

Regards,

Robert

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 3:21:01 PM5/20/19
to rn...@crealytics.de, adwor...@googlegroups.com
Hi Robert,

Thanks for following up on this. I spent some time trying to investigate this and couldn't figure out why there's a discrepancy in behavior. I've filed a bug with the engineering team, hopefully they can't help resolve the situation quickly.

Best,
Ben, Google Ads API Team

ref:_00D1U1174p._5001UAq8xI:ref

Google Ads API Forum Advisor Prod

unread,
May 20, 2019, 4:19:30 PM5/20/19
to rn...@crealytics.de, adwor...@googlegroups.com

Hi Robert,

Could you share the details of requests you were making with the AdWords API that were successful? That would help our investigation.

Thank you!


Ben, Google Ads API Team 



ref:_00D1U1174p._5001UAq8xI:ref

Robert Heise

unread,
May 21, 2019, 4:37:22 AM5/21/19
to AdWords API and Google Ads API Forum
Hi Ben,

on the Adwords API we're using a request very similar to the ruby code documented in https://developers.google.com/adwords/api/docs/samples/ruby/optimization#get-a-bid-landscape-for-an-ad-group-and-criterion . Try the query and get the first page - without providing AdGroup and CriterionId for the accounts I sent you in private. Via the Adwords API, all accounts return data - via the Ads API some accounts return only an empty result and no errors.

Regards,

Robert

Google Ads API Forum Advisor Prod

unread,
May 21, 2019, 8:51:25 AM5/21/19
to rn...@crealytics.de, adwor...@googlegroups.com
Thanks Robert,

I think I may know what the issue is now. The API does not yet support simulations for shopping-related entities. That functionality will be introduced in an upcoming release. I took another glance at the two accounts that are returning empty results and it appears that most of the campaigns and ad groups are shopping related. Would you expect those accounts to return any non-shopping related simulations?

Thanks,

Robert Heise

unread,
May 21, 2019, 9:04:56 AM5/21/19
to AdWords API and Google Ads API Forum
Hi Ben,

thanks for investigating. Yes, the accounts are basically shopping only - and exactly for those (i.e. product partitions) I'd be interested in the simulations.

Can you give more details which upcoming release (and especially when) will contain shopping-related simulations?

Thanks,

Robert

Google Ads API Forum Advisor Prod

unread,
May 21, 2019, 1:13:44 PM5/21/19
to rn...@crealytics.de, adwor...@googlegroups.com
Hi Robert,

Unfortunately I don't know exactly when those simulations will be added to the API but I checked with the team and they are actively being worked on and are a high priority, so it should hopefully be soon.

Once they're added the announcement will be made on our developer blog, so be sure to keep an eye on that page.

Best,
Reply all
Reply to author
Forward
0 new messages