Posts under category Google

I want to build a web application. Clients can use the web application to read their google Adwrods accounts information( campagins or budgets ).

First, I use oath2 get client's refresh_token and access_token. Using the refresh_token, I can get all adwords id under the client by (https://github.com/googleads/google-ads-ruby)

client = Google::Ads::GoogleAds::GoogleAdsClient.new do |config|   config.client_id = "client_id"   config.client_secret = "client_secret"   config.refresh_token = "refresh_token"   config.login_customer_id = "XXX-XXX-XXXX"   config.developer_token = "XXXXXXXXXXXXXXXX" end accessible_customers = client.service.customer.list_accessible_customers().resource_names 

When I want to get client Adword account information,

resource_name = client.path.customer("XXXXXXXX") customer = client.service.customer.get_customer(resource_name: resource_name) 

I get "GRPC::Unauthenticated: 16:Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential", but the config file can't let me set access_token.

So, where can i set client's access_token, or which step i missed?

Before trying with the production data, I'm going to try using the Google Ads API with a test account. I have already set up that and I have the Customer ID, manager account customer ID, and the developer token. The next step in the docs states I need to set up the .yaml file which has the follwing fields:

developer_token: INSERT_DEVELOPER_TOKEN_HERE client_id: INSERT_OAUTH2_CLIENT_ID_HERE client_secret: INSERT_OAUTH2_CLIENT_SECRET_HERE refresh_token: INSERT_REFRESH_TOKEN_HERE login_customer_id: INSERT_LOGIN_CUSTOMER_ID_HERE 

My question here is what is the client_id and client_secret? I know that the refresh_token needs to set up like this in their docs: https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-installed

Is the client_id and secret_id the OAuth 2.0 Client IDs setup in the my personal account in the developer console?

*I am using the Google Ads API and NOT the AdWords API

I am able to access the play console buckets through gsutil scripts. Now I want to access the adwords (uses same gmail account) but there is no clear documentation for that. There are hints that it may be paid as well. Has anyone done that? What are the steps and is it free or paid.

After importing our Firebase app events in Google Ads as conversions, their status stays at "no recent conversions". The events are recordeding fine in Firebase.

  • Both our native iOS and Android app are implemented, but none show conversions in Google Ads
  • The package name of one of our apps was updated
  • We unlinked Google Ads from Firebase and linked it again, but that didn't work either
  • We are talking about custom events (an in-app action) and native events (like first open)

It seems like we can't really delete conversions. We can delete and re-enable, but can't "start over".

How can we make recording our events as conversions work?

I want to connect -any- customer Google AdWords Account with Google Login. (Like Wordstream)

I prepared a code, but there is a problem somewhere, I can't run it.

When the customer press the connect button, the screen appears. It says "XXX wants to acces your Google Account", it is approved but I cannot receive data.

How can i get datas from customer's account?

Code:

require 'google-api/vendor/autoload.php'; use Google\Auth\OAuth2; use Google\AdsApi\AdWords\AdWordsServices; use Google\AdsApi\AdWords\AdWordsSessionBuilder; use Google\AdsApi\AdWords\v201809\cm\CampaignService; use Google\AdsApi\Common\OAuth2TokenBuilder; session_start(); $oauth2 = new OAuth2([          'authorizationUri' => 'https://accounts.google.com/o/oauth2/v2/auth',     'tokenCredentialUri' => 'https://www.googleapis.com/oauth2/v4/token',     'redirectUri' => 'https://xxxxx.xxxxxx',     'clientId' => 'xxxxxxxxx.apps.googleusercontent.com',     'clientSecret' => 'xxxxxxxxxxx',     'scope' => 'https://www.googleapis.com/auth/adwords',     'refresh_token' => 'xxxxxxxxxx' ]); if(!isset($_GET['code'])){          $oauth2->setState(sha1(openssl_random_pseudo_bytes(1024)));     $_SESSION['oauth2state'] = $oauth2->getState();     $config = [              'access_type' => 'offline',         'prompt' => 'consent',     ];          header('Location: ' . $oauth2->buildFullAuthorizationUri($config));     exit;    } elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])){          unset($_SESSION['oauth2state']);     exit('Invalid state.');    } else {          $oauth2->setCode($_GET['code']);     $authToken = $oauth2->fetchAuthToken();     $refreshToken = $authToken['refresh_token'];          $path = "xxxxx/google-api/vendor/adsapi_php.ini";     $session = (new AdWordsSessionBuilder())         ->fromFile($path)         ->withOAuth2Credential($oauth2)         ->build();          $adWordsServices = new AdWordsServices();          $campaignService = $adWordsServices->get($session, CampaignService::class);          print_r($campaignService); }