Posts under category Google

  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!

Google has the following docs for the ad manager here. Unfortunately their example:

# Set the start and end dates of the report to run (past 8 days). end_date = date.today() start_date = end_date - timedelta(days=8) # Create report job. report_job = {     'reportQuery': {         'dimensions': ['LINE_ITEM_ID', 'LINE_ITEM_NAME'],         'columns': ['AD_SERVER_IMPRESSIONS', 'AD_SERVER_CLICKS',                     'AD_SERVER_CTR', 'AD_SERVER_CPM_AND_CPC_REVENUE',                     'AD_SERVER_WITHOUT_CPD_AVERAGE_ECPM'],         'dateRangeType': 'CUSTOM_DATE',         'startDate': start_date,         'endDate': end_date     } } # Initialize a DataDownloader. report_downloader = client.GetDataDownloader(version='v202008') try:   # Run the report and wait for it to finish.   report_job_id = report_downloader.WaitForReport(report_job) except errors.AdManagerReportError as e:   print('Failed to generate report. Error was: %s' % e) with tempfile.NamedTemporaryFile(     suffix='.csv.gz', mode='wb', delete=False) as report_file:   # Download report data.   report_downloader.DownloadReportToFile(       report_job_id, 'CSV_DUMP', report_file) 

yields a KeyError: 'date' on the report_job_id line. My authorization is correct and I can make other calls with my client. My question is, how does one need to update report_job in order for the example to work. I tried changing 'dateRangeType' however this states it must be 'CUSTOM_DATE'.