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

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/76ba2cac-420b-4202-bd53-95d2d053e6fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • [Google... Robert Heise
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
    • Re... Robert Heise
    • Re... Robert Heise
    • Re... Robert Heise
    • RE... Google Ads API Forum Advisor Prod
    • RE... Google Ads API Forum Advisor Prod
      • ... Robert Heise
    • RE... Google Ads API Forum Advisor Prod
    • RE... Google Ads API Forum Advisor Prod

Reply via email to