Posts tagged with google-ads-api

I'm able to list ads:

https://developers.google.com/google-ads/api/fields/v5/ad_group_ad

select     ad_group_ad.ad.id,     ad_group_ad.ad.name from     ad_group_ad 

And media files:

https://developers.google.com/google-ads/api/fields/v5/media_file

select     media_file.id,     media_file.media_bundle.url from     media_file 

But I'm unable to connect the two. I tried many things:

This gives: The following field may not be used in SELECT clause: 'ad_group_ad.ad.image_ad.media_file'.

select     ad_group_ad.ad.id,     ad_group_ad.ad.image_ad.media_file from     ad_group_ad 

Then this gives: Unrecognized field in the query: 'ad_group_ad.ad.image_ad.media_file.id'.

select     ad_group_ad.ad.id,     ad_group_ad.ad.image_ad.media_file.id from     ad_group_ad 

And tried to remove all the prefixes from ad_group_ad.ad.image_ad.media_file.id without any success. I also tried the ad_group_ad_asset_view, but that returned empty response for all the customers I tried, and it also doesn't have a media file ID.

Is there a solution?

  1. When I run an ads-script to call the "spreadsheet" API. I want to enrich a sheet by duplicating some rows according to values I have in a script.

How should I do this effectively?

only by creating a new tab? Starting from the last row? As I change the range while iterating.

  for ( i = 0; i < lastColumn - 1; i++){     for ( j = 0 ; j < lastRow - 1; j++){       var kw_data = kw_to_label[rangeValues[j][i]];         if(kw_data != null){         sheet.getRange(j,i).setValue(kw_data.labels[k]);   

An example:

dict: k1 -> val1, val2 k2 -> val3 

and sheet:

I'm need to get GCLID value inside my android app. What i found is Play Install Referrer Library, that returns me a utm tags, but i'm not sure that GCLID value will be inside val referrer = response.installReferrer

Code sample:

 fun getGCLID(){         referrerClient = InstallReferrerClient.newBuilder(this).build()         referrerClient.startConnection(object : InstallReferrerStateListener {             override fun onInstallReferrerSetupFinished(responseCode: Int) {                 when (responseCode) {                     InstallReferrerClient.InstallReferrerResponse.OK -> {                         // Connection established.                         val response: ReferrerDetails = referrerClient.installReferrer                         val referrer = response.installReferrer                         val clickTimestamp = response.referrerClickTimestampSeconds                         val installTimestamp = response.installBeginTimestampSeconds                         Log.d("TagGCLID", "onInstallReferrerSetupFinished: 1")                         if ("gclid" in referrer) {                             Log.d("TagGCLID", "GCLID is detected in referrer // is $referrer")                             //report to Firebase Analytics                         } else {                             Log.d("TagGCLID", "no GCLID is detected in referrer\n" +                                     "$referrer")                             //do something else                         }                     }                     InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -1")                         // API not available on the current Play Store app.                     }                     InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE -> {                         Log.d("TagGCLID", "InstallReferrerResponse: -2")                         // Connection couldn't be established.                     }                 }             }             override fun onInstallReferrerServiceDisconnected() {                 Log.d("TagGCLID", "onInstallReferrerServiceDisconnected: -3")                 // Try to restart the connection on the next request to                 // Google Play by calling the startConnection() method.             }         })     } 

What i'm suppose to do to get GCLID value?

We've followed the advice given here: https://developers.google.com/google-ads/api/docs/client-libs/java/logging

Neither of the proposed solutions have any visible effect on what is logged to the console, either in dev or in deployment.

Specifically:

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-log4j12</artifactId>       <version>1.7.25</version>   </dependency> 
  • added -Dlog4j.configuration=googleads-logging/log4j.properties to the launch command

no effect.

  • added to pom.xml:

      <dependency>       <groupId>org.slf4j</groupId>       <artifactId>slf4j-jdk14</artifactId>       <version>1.7.25</version>   </dependency> 
  • created jdk-logger.properties in various places, from example found here

  • added -Djava.util.logging.config.file= to the launch command

no effect whatsoever.

We are desperately trying to sort out this issue before Google sunsets the googleads v2 API on October 21. It would be really nice to see exactly what is happening, but so far all we've managed to determine is the endpoint server: googleads.googleapis.com:443

Any advice highly appreciated!