Posts tagged with java

The problem is - is there a way to retrieve the ad with size of 728*90 and set it to my view which is 600*90?

The problem is that the Ad is truncated in the portrait mode while in the landscape it looks good.

Portrait:

Landscape:

I use tablet and in order to represent the Ad I use AdManagerAdView.

I found out where the problem is - the problem is that the app requests the ad with the size of (w:) 728 * (h:) 90, however, the width of the tablet is 600dp, so it is obvious that 128dp is kind of out of the screen.

I tried to check all possible ad sizes described here - https://developers.google.com/ad-manager/mobile-ads-sdk/android/banner#banner_sizes

these sizes:

            this.setAdSizes(AdSize(320, 50)) +             this.setAdSizes(AdSize(320, 100))             this.setAdSizes(AdSize(300, 250)) +             this.setAdSizes(AdSize(468, 60))             this.setAdSizes(AdSize(728, 90)) + 

However, I wasn't able to retrieve all the ads by thier sizes, I only got these:

            this.setAdSizes(AdSize(320, 50)) +             this.setAdSizes(AdSize(300, 250)) +             this.setAdSizes(AdSize(728, 90)) + 

From this point I made a conclusion that a publisher provides only these specific ads sizes. For me it means that if it is nessasary to use smaler ad that 728*90 the next size would be 300*250 which is more than twice narrowed than I need (600dp).

So the next idea was to use NativeAd (https://developers.google.com/ad-manager/mobile-ads-sdk/android/native/start), however, I get an error:

onAdFailedToLoad: {                    "Code": 3,                    "Message": "No ad config.",                    "Domain": "com.google.android.gms.ads",                    "Cause": "null",                    "Response Info": {                      "Response ID": "null",                      "Mediation Adapter Class Name": "",                      "Adapter Responses": []                    }                  } 

So as far as I undestand there is no way just to start to use NativeAd, it should be configurated on the publisher end first (as far as I see), because once I tried to made a request with the same credentials (as for AdManagerAdView), I get this config error, looks like NativeAd config is not existing on the publisher end.

So, finally the question is - is there a way to retrieve the ad with size of 728*90 and set it to my view which is 600*90?

We are sending enhanced conversions to Google ADS API using the Upload Click Conversions method of the API client. This is the only data we send to API. No user identifier data about customers is sent to API before that via GTM. In Google Ads UI measurements, I see that Google only shows 5% of what actual conversions are. Does this mean we need to send Google Ads API some information through GTM before we send the conversions through the API client?

I am working with Google Ads API. Based on my use case, I need to get the impressions, clicks, and other statistics about the products based on location(Without creating the campaign).

I contacted the Google Ads API team to address the issue but the doc reference they provided me didn't work in my case. (I'm not using keywords also)

  1. generate forecast metrics

And also the query I used to access the data is...

public void queryTest(long customerId,String campaignId) {     try (GoogleAdsServiceClient googleAdsServiceClient =                  googleAdsClient.getLatestVersion().createGoogleAdsServiceClient()) {         SearchGoogleAdsStreamRequest request =                 SearchGoogleAdsStreamRequest.newBuilder()                         .setCustomerId(Long.toString(customerId))                         .setQuery("SELECT metrics.clicks, metrics.impressions,geographic_view.country_criterion_id FROM geographic_view WHERE geographic_view.country_criterion_id = 1009919")                         .build();         ServerStream<SearchGoogleAdsStreamResponse> stream =                 googleAdsServiceClient.searchStreamCallable().call(request);         for (SearchGoogleAdsStreamResponse response : stream) {             for (GoogleAdsRow googleAdsRow : response.getResultsList()) {                 System.out.println("outPut"+googleAdsRow.getGeographicView());             }         }     } } 

Can someone please help me to resolve this issue?? Thank you!!

Migrating from AdWords to GoogleAds api.

Querying search_term_view:

val googleAdsClient: GoogleAdsClient = GoogleAdsClient.newBuilder()   .setCredentials(credential)   .setDeveloperToken(developerToken)   .setLoginCustomerId(loginCustomerId.toLong)   .build()     val svc = googleAdsClient.getLatestVersion.createGoogleAdsServiceClient() val query = s"""   SELECT      segments.keyword.info.text     ,search_term_view.search_term     ,segments.date   FROM search_term_view   WHERE segments.date BETWEEN '2022-01-01' AND '2022-01-01' """ svc.search(customerId, query).iteratePages().asScala.foreach { page =>   page.iterateAll().asScala.foreach { row =>     //row processing   } } 

The issue is that svc.search() skips rows, if one of columns is null. So getting results like

text1,term1 text2,term2 

While same request to Adwords api returns results like

text1,term1 text2,term2 --,term3 

Haven't found anything about nulls ignoring in docs.

Using latest google ads v10 lib: "com.google.api-ads" % "google-ads" % "17.0.1"