Posts under category Google

I use the library 'com.google.android.gms: play-services-ads: 19.1.0' for advertising, I create a banner as follows: https://developers.google.com/admob/android/banner/adaptive so that it always turned out to be the full width of the screen and everything works well, but sometimes black lines appear enter image description here

please tell me how can I remove them? I tried transparent styles and setting the background color,

android: theme = "@ style / TranslucentTheme" android: background = "@ color / transparent"

In xml and through the code, and nothing helps.

Illuminate\Contracts\Container\BindingResolutionException Unable to resolve dependency [Parameter #0 [ $customerId ]] in class App\Jobs\BudgetFetch

namespace App\Http\Controllers; use App\Jobs\BudgetFetch; use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder; use Google\Ads\GoogleAds\Lib\V3\GoogleAdsClientBuilder; use Illuminate\Support\Facades\DB; class APIController extends Controller{     public function index(){         $clients = DB::table('account_names')->pluck('code');         foreach($clients as $customerId) {             budgetFetch::dispatch($customerId);         }     } } 

The above is a simple controller I've put together to trigger another job which is;

namespace App\Jobs; use Illuminate\Bus\Queueable; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Foundation\Bus\Dispatchable; use Illuminate\Queue\InteractsWithQueue; use Illuminate\Queue\SerializesModels; use Google\Ads\GoogleAds\Lib\OAuth2TokenBuilder; use Google\Ads\GoogleAds\Lib\V3\GoogleAdsClientBuilder; class BudgetFetch implements ShouldQueue{     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;     /**      * Create a new job instance.      *      * @return void      */     public function __construct(){     }     /**      * Execute the job.      *      * @return void      */     public function handle($customerId){         $clientId = "xxxxxxxxxxxx";         $clientSecret = "xxxxxxxxxxx";         $refreshToken = "xxxxxxxxxxxxxxxxxx";         $developerToken = "xxxxxxxxxxxxxxxxxx";         $loginCustomerId = "xxxxxxxxxxx";         $oAuth2Credential = (new OAuth2TokenBuilder())             ->withClientId($clientId)             ->withClientSecret($clientSecret)             ->withRefreshToken($refreshToken)             ->build()         ;         $googleAdsClient = (new GoogleAdsClientBuilder())             ->withDeveloperToken($developerToken)             ->withLoginCustomerId($loginCustomerId)             ->withOAuth2Credential($oAuth2Credential)             ->build()         ;         $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();         $query = 'SELECT campaign.id, campaign.name, metrics.cost_micros, campaign_budget.amount_micros FROM campaign ORDER BY campaign.id';         /** @var GoogleAdsServerStreamDecorator $stream */         $stream =             $googleAdsServiceClient->searchStream($customerId, $query);         foreach ($stream->iterateAllElements() as $googleAdsRow) {             /** @var GoogleAdsRow $googleAdsRow */             $metrics = $googleAdsRow->getMetrics();             $id = $googleAdsRow->getCampaign()->getId()->getValue();             $name = $googleAdsRow->getCampaign()->getName()->getValue();             $spend = $googleAdsRow->getCampaignBudget()->getAmountMicros()->getValue();             $budget = $metrics->getCostMicrosUnwrapped();             if($spend >= $budget){                 DB::table('budget_alerts')->insert(                     ['campaign' => $id, 'hitBudget' => 1]                 );             };         }     } } 

The error at the top of the question is what I get from this, If I put the variable in __construct the same thing happens. I've run a php artisan clear-compiled which I found in another question similar and it didn't seem to fix anything.

I am trying to download a SHOPPING_PERFORMANCE_REPORT with the following fields:

  • OfferId
  • ProductTitle
  • Brand
  • Date
  • Impressions

For a small subset of records I'm getting empty/blank data for OfferId, ProductTitle, and Brand (only Date and Impressions are not null). I want to exclude NULL OfferId and the filter: WHERE OfferID != '' doesn't seem to make any difference. How do I exclude NULL values from my report query??

THE SITUATION:

I am trying to display preroll ads videos on my app.

I have two different adTagUrl.
One works fine and the preroll ad is displayed.
The other doesn't, and I get an empty VAST response instead.

I thought there may be something wrong in the code, so I recreate a basic small app taking the code from the google IMA repo example.

The results is the same. One work and the other doesn't.

THE ERROR:

errorCode: 1009 errorMessage: "The VAST response document is empty." type: "adLoadError" 

VAST INSPECTOR:

If I check the VAST ad response using the Google Video Suite Inspector, both the adTagUrl work.

THE CODE:

The code is very straightforward, taken from the google IMA example repo:

var adsRequest = new google.ima.AdsRequest(); adsRequest.adTagUrl = 'MY_TAG_URL'; adsRequest.linearAdSlotWidth = 640; adsRequest.linearAdSlotHeight = 400; adsRequest.nonLinearAdSlotWidth = 640; adsRequest.nonLinearAdSlotHeight = 150; adsLoader.requestAds(adsRequest); 

THE QUESTION:

Why am I getting that error?

How it's possible that the adTagUrl works fine in the Vast Inspector, but it doesn't work when I request it from the code?