Posts under category google-ads-api

When I run an iOS app using the AdMob plugin on a device, the console log keep repeating with high frequency.

ProcessThrottler::Activity::invalidate: Ending foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     ProcessThrottler::Activity::Activity: Starting foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     ProcessThrottler::Activity::invalidate: Ending foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     ProcessThrottler::Activity::Activity: Starting foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     ProcessThrottler::Activity::Activity: Starting foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     ProcessThrottler::Activity::invalidate: Ending foreground activity / 'WebPageProxy::runJavaScriptInFrameInScriptWorld'     .... 

The Google-Mobile-Ads-SDK updated to latest version 8.12.0. If I disable GADAdLoader and GADBannerView, the repeating log will be disappeared.

I am trying to get the reports such as geo_performance_report, keywords_perfromance_report etc. but I am unable to figure how do to this with the new version of google-ads api. I tried this way trying to use the new google-ads but was not successful. is there any other ways to automate this process using Python.

def googleads_report(client, client_id, report_type, columns, start_date, end_date):     client.SetClientCustomerId(client_id)     report_downloader = googleads_client.GetReportDownloader(version="v201809")     report = {         'reportName': 'report-google-campaign-performance',         'dateRangeType': 'CUSTOM_DATE',         'reportType': report_type,         'downloadFormat': 'CSV',         'selector': {             'fields': columns,             'dateRange': {'min': start_date, 'max': end_date}         }     }     file = io.StringIO(report_downloader.DownloadReportAsString(         report,         skip_report_header=True,         skip_column_header=True,         skip_report_summary=True,         include_zero_impressions=False)     )     df = pd.read_csv(file, names=columns)     return df def main(client, customer_id):     keyword_columns = [         'Date',         'AccountDescriptiveName',         'AdGroupId',         'AdGroupName',         'AdGroupStatus',         'CampaignId',         'CampaignName',         'CampaignStatus',         'CpcBid',         'Criteria',         'CriteriaDestinationUrl',         'ExternalCustomerId',         'FirstPageCpc',         'FirstPositionCpc',         'Id',         'KeywordMatchType',         'Labels',         'QualityScore',         'SearchImpressionShare',         'Status',         'TopOfPageCpc',         'Clicks',         'Conversions',         'Cost',         'ConversionValue',         'Impressions',         'ViewThroughConversions'     ]     report_types = [         'KEYWORDS_PERFORMANCE_REPORT'     ]     for report in report_types:         base_df = pd.DataFrame()         if report == 'CAMPAIGN_PERFORMANCE_REPORT':             table_suffix = 'campaigns'             #columns = campaign_columns         elif report == 'KEYWORDS_PERFORMANCE_REPORT':             table_suffix = 'keywords'             columns = keyword_columns         elif report == 'AD_PERFORMANCE_REPORT':             table_suffix = 'ads'             #columns = ad_columns         start_date = '2019-01-01'         df = googleads_report(client,customer_id, report, columns, start_date, yesterday)         df = df.applymap(str)         # Powershell output         print(df.head())         # csv output         df.to_csv('my_path' + table_suffix + '.csv') if __name__ == "__main__":     # GoogleAdsClient will read the google-ads.yaml configuration file in the     # home directory if none is specified.     googleads_client = GoogleAdsClient.load_from_storage(path="mypath")     today = datetime.now().date()     yesterday = today - timedelta(days=1)     thirty_days_ago = today - timedelta(days=30)     try:         main( googleads_client, "#######")     except GoogleAdsException as ex:         print(             f'Request with ID "{ex.request_id}" failed with status '             f'"{ex.error.code().name}" and includes the following errors:'         )         for error in ex.failure.errors:             print(f'\tError with message "{error.message}".')             if error.location:                 for field_path_element in error.location.field_path_elements:                     print(f"\t\tOn field: {field_path_element.field_name}")             sys.exit(1) 

I am using the below code sample from GTP docs to refresh the ad automatically in a specific time interval. But, the slot is cleared when it fetches a new ad and the response is empty. Is it possible to prevent clearing the slot until I get a successful response?

googletag.cmd.push(function() {   var REFRESH_KEY = 'refresh';   var REFRESH_VALUE = 'true';   googletag.defineSlot('/6355419/Travel',[728, 90], 'div-for-slot')       .setTargeting(REFRESH_KEY, REFRESH_VALUE)       .setTargeting('test', 'event')       .addService(googletag.pubads());   // Number of seconds to wait after the slot becomes viewable.   var SECONDS_TO_WAIT_AFTER_VIEWABILITY = 60;   googletag.pubads().addEventListener('impressionViewable', function(event) {     var slot = event.slot;     if (slot.getTargeting(REFRESH_KEY).indexOf(REFRESH_VALUE) > -1) {       setTimeout(function() {         googletag.pubads().refresh([slot]);       }, SECONDS_TO_WAIT_AFTER_VIEWABILITY * 1000);     }   });   googletag.enableServices(); });