Posts tagged with java

We are in process of migrating code from Ad Words to Google Ads. First step from this is to get all customers which are assigned to for logged in user. For this Ad Words has an API called "CustomerServiceInterface.getCustomers" method which returns all customers at once.

But in Google Ads, there doesn't seem to be similar method. All we could find was get-account-hierarchy

Looking at the code, it is getting all child accounts by recursion method.

This has a major performance bottleneck as it has to iterate over all accessible customers first and then recursively over all manager and their children.

Question for the experts here - is there any efficient way I can get all customers at once? At least can we get all managers accessible to logged in user?

We did find a relevant article - https://groups.google.com/g/adwords-api/c/UHWxe7ag7zI. But that seems to talk about API quota rather than performance.

I figured out how to create & delete keyword plans, but I couldn't figure out how I can get a list of all my existing keyword plans (resource names / plan ids)?

final long customerId = Long.valueOf("XXXXXXXXXX");     GoogleAdsClient googleAdsClient = new ... KeywordPlanServiceClient client = googleAdsClient.getVersion8().createKeywordPlanServiceClient(); String[] allExistingKeywordPlans = client. ??? 


<dependency>     <groupId>com.google.api-ads</groupId>     <artifactId>google-ads</artifactId>     <version>16.0.0</version> </dependency> 


Further resources: https://developers.google.com/google-ads/api/docs/samples/add-keyword-plan

Any hints on how this can be solved is highly appreciated! Many thanks in advance!

I am using Adwords API. But the support for Adwords will end in 2022. I want to migrate to new Google Ads API. I want to know the equivalent of AD_PERFORMANCE_REPORT(which was in Adwords) in Google Ads.

For example, the equivalent for KEYWORD_PERFORMANCE_REPORT is keyword_view.

I tried to find it a lot but couldn't get it.

Thanks in advance.

I tried to clone the Google Ads GitHub library (adwords-axis-jars-and-examples) but when I try to run the GetCampaigns.java file I get this error: build output in IntelliJ

So I tried to change the compiler settings that people have recommended, still no luck. Compiler settings

I downloaded the adwords-axis-jars-and-examples, but do I need to download the adwords-axis-maven-and-examples for this GitHub library?

If you can help me with this I will Venmo or Cash App you $. I'm just learning how to program so forgive me in advance.

Although I have implemented com.google.android.gms.ads:20.0.0 in my project, still I am not able to use interstitialAd.setAdUnitId(), loadAd.
Here is what I have:

import androidx.multidex.BuildConfig; import com.google.android.gms.ads.Adlistener; import com.google.android.gms.ads.AdRequest; import com.google.android.gms.ads.IntersitialAd; import com.google.android.gms.ads.intersitital.IntersisitalAd; 

Here is where I'm trying to use the method:

public void interstitalLoadAd(Context context){     mInterstitialAd = new InterstitialAd(context);     mInterstitialAd.setAdUnitId(BuildConfig.DEBUG ?         TEST_INTERSTITIAL_AD_UNIT_ID :         INTERSTITIAL_AD_UNIT_ID);     mInterstitialAd.loadAd(new AdRequest.Builder().build());     mInterstitialAd.setAdListener(this); } public void showAd(){     if (mInterstitialAd.isLoaded()){         mInterstitialAd.show();  }