Posts under category google-ads-api

This code is being used on aws lambda for making Google ads client

try:     googleads_client = GoogleAdsClient.load_from_dict(credentials, version="v11",) except GoogleAdsException as e:     print(f"Google Ads Exception: {e.message}") 

Unfortunately this is running into time out issue even if the time is set to 3 minutes. As there is no error, It is not possible to debug the issue. Any experienced developer can share some tips? Thanks alot

I searched some forums about how to prevent sql injection in python and saw that there are ways to use a code like the following:

nome = "'Carlos' , idade = 80" cursor.execute("UPDATE cliente SET nome=%(nome)s WHERE idcliente=13", ({'nome': nome, }))

Most of the examples I see the variable 'cursor.execute' and an execute next to it, I would like to know how to replicate this in the Google ads API.

I want to know if have some 'cursor.execute' in Google Ads API...

I am running google ads and having invalid click issues my ad serve only in Dubai, problem i face my competitor click bomb my ad from UK, FRACE and other countries mostly from Europe and Britain, I excluded all the world expect Dubai but my competitor still able to see my ad and clicking them with some kind of bot till Dawn to Dusk.

I talked with google and they said our system filter invalid clicks but still 30 to 50 percent clicks google consider legit.

I come up with a solution by installing a plugin in WordPress and filtering traffic by filtering URL with "/?gclid=" parameter. But now I have to do it manually.

My question is there any automate rule in WordPress so I can block an IP address automatically if he click on my ad more then a couple of times.

Using bellow code I can get the access and refresh token:

private const SCOPE                 = 'https://www.googleapis.com/auth/adwords'; private const AUTHORIZATION_URI     = 'https://accounts.google.com/o/oauth2/v2/auth'; private const OAUTH2_CALLBACK_PATH  = ''; private const REDIRECT_URL          = 'http://localhost:3000/google/google-ads/confirmed'; $code           = $request->input('code'); $scope          = $request->input('scope'); $state          = $request->input('state'); $project_token  = $request->input('project_token'); $project_name   = $request->input('project_name'); $account_name   = $request->input('account_name'); $account_id     = $request->input('account_id'); $clientId       = 'my-client-id--kh3el.apps.googleusercontent.com'; $clientSecret   = 'my-clicent-secret4cCm'; $redirectUrl    = self::REDIRECT_URL; $oauth2 = new OAuth2(     [         'clientId'              => $clientId,         'clientSecret'          => $clientSecret,         'authorizationUri'      => self::AUTHORIZATION_URI,         'redirectUri'           => $redirectUrl . self::OAUTH2_CALLBACK_PATH,         'tokenCredentialUri'    => CredentialsLoader::TOKEN_CREDENTIAL_URI,         'scope'                 => self::SCOPE,         // Create a 'state' token to prevent request forgery. See         // https://developers.google.com/identity/protocols/OpenIDConnect#createxsrftoken         // for details.         'state' => sha1(openssl_random_pseudo_bytes(1024))     ] ); // Set the authorization code and fetch refresh and access tokens. $oauth2->setCode($code); $authToken = $oauth2->fetchAuthToken(); $refreshToken   = isset( $authToken['refresh_token'] ) ? $authToken['refresh_token'] : ''; $accessToken    = $oauth2->getAccessToken(); 

now how can I get the emaill address? Is there any way?

I need to load a Portrait Full-screen native ad.

I have set the nativeAdOptions like these
val nativeAdOptions = NativeAdOptions.Builder().setMediaAspectRatio(MediaAspectRatio.PORTRAIT).build()

and load the ad like this

AdLoader.Builder(context, adUnitId).withNativeAdOptions(nativeAdOptions) 

Even I set the MediaAspectRatio to MediaAspectRatio.PORTRAIT. I am getting landscape ads.

Is there any issue with Google Ad Manager SDK or Do I need to specify any extra AdOptions?