I'm not sure what to put in the withCondition to get all such videoAds.

var videoAds = AdsApp                 .videoAds()                 .withCondition('????')                                     .get(); while (videoAds.hasNext()) {     var videoAd = videoAds.next();     data.push([         videoAd.getVideoCampaign().getId(),         videoAd.getVideoCampaign().getName(),         videoAd.getVideoAdGroup().getId(),         videoAd.getVideoAdGroup().getName(),         videoAd.getId(),         videoAd.getName(),     ]); } 

I am using GoogleAdsApi - and I have the query below that works great. :)

report_query = (adwords.ReportQueryBuilder()                   .Select(                     'Date','AdGroupId','AdGroupName','CampaignId','CampaignName',                                      'Impressions','Clicks',                           'Cost'                           ,'Conversions','ConversionRate','Ctr','AverageCpc','CostPerConversion'                           )                    .From('CRITERIA_PERFORMANCE_REPORT')                   .Where('Status').In('ENABLED',                    'PAUSED')                   .During('20200101,20210331')                   .Build()) 

I would like to make this function more dynamic by creating a date variable (I have listed below) and possibly more variables let's say field as well. When I try to create & pass in variables ,it does not work

fields = "'Date','AdGroupId','AdGroupName','CampaignId','CampaignName','Impressions','Clicks','Cost','Conversions','ConversionRate','Ctr','AverageCpc','CostPerConversion'" today = date.today() yesterday = today - timedelta(days = 1) date_filter = f'\'{yesterday.strftime("%Y%m%d")},{today.strftime("%Y%m%d")}\''  report_query = (adwords.ReportQueryBuilder()                       .Select(                        fields                               )                        .From('CRITERIA_PERFORMANCE_REPORT')                       .Where('Status').In('ENABLED',                        'PAUSED')                       .During(date_filter)                       .Build()) 

I get the error below:

googleads.errors.AdWordsReportBadRequestError: Type: QueryError.INVALID_DURING_CLAUSE 

Even though when I pass in the printed value of my date variable, instead of the date variable into .During, it works. So a little confused.

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();  } 

I am using a Google Ads php library (https://github.com/googleads/googleads-php-lib) to manage my own google ads account, following Google's instructions here (https://developers.google.com/adwords/api/docs/guides/first-api-call)

(I've actually been doing this for many years without a problem, but I recently switched over to using a different project in the Google Cloud Platform, so I had to update my credentials and get a new refresh token)

To get a new refresh token, I ran the php script called GetRefreshTokenWithoutIniFile.php (which allows me to grant offline access and retrieve a new refresh token, which I store in a file auth.ini for future use).

The refresh token last for a few days, before I see this error:

{     "error" : "invalid_grant",     "error_description" : "Token has been expired or revoked." } 

I have been using the above method for years and the refresh token has never expired. However, it now seems to expire every couple of days. I am certainly not 'running out' of refresh tokens (I only request one), and the user is not revoking access (the user is me). For that reason, these similar answers don't help me:

Any more ideas?