Hi I'm trying to connect an python script with google ads api.

I have: Ads Account manager with developer_token and the the account level is in "Test Account" Google ads api -> enabled.

service account added to the api and with file service.json and email like service_acc@project.iam.gserviceaccount.com

google-ads.yaml with

json_key_file_path: 'service.json' impersonated_email: 'service_acc@project.iam.gserviceaccount.com' use_proto_plus: True developer_token: 'developer_token' 

client_ads_id (supuse to be in ads.google.com in help -> customer Id) 10 digits without

I can access client api with client = googleads.client.GoogleAdsClient.load_from_storage() with no error.

Then I try to create a user list with

user_list_service_client = client.get_service("UserListService") user_list_operation = client.get_type("UserListOperation") user_list = user_list_operation.create user_list.name = list_name user_list.description = description user_list.crm_based_user_list.upload_key_type = (    client.enums.CustomerMatchUploadKeyTypeEnum.CONTACT_INFO         ) user_list.membership_life_span = 365 response = user_list_service_client.mutate_user_lists(             customer_id=customer_id, operations=[user_list_operation]         ) 

In the last line I get an error:

errors {   error_code {     authentication_error: NOT_ADS_USER   }   message: "User in the cookie is not a valid Ads user." } 

and in the middle of the exception I got

status = StatusCode.UNAUTHENTICATED 

I don't know how to link the client ads account with the api service account.

I've try to:

  1. The service account is not linked to the ads client. (I've invited to service_acc@project.iam.gserviceaccount.com but... obviously it doesn't arrive and doesn't accept the invitation automatically)
  2. In this doc talk about impersonate, and don't know how to do it

A Google Ads user with permissions on the Google Ads account you want to access. Google Ads does not support using service accounts without impersonation

I am testing the Single Product Message API endpoint in Whatsapp-Business Cloud.

It is working for some of the products in the catalogue, but for some other products in the same catalogue giving error as 'product not found for product_retailer_id, XX, in catalog_id, XXXXXXXXX'

I can't see any Issue / Policy violations for those products.

This is the Sample Request Payload

{     "messaging_product": "whatsapp",     "recipient_type": "individual",     "to": "XXXX",     "type": "interactive",     "interactive": {         "type": "product",         "body": {             "text": "Hello 111111"         },         "footer": {             "text": "Hello1 1111111"         },         "action": {             "catalog_id": "XXXX",             "product_retailer_id": "XX"         }     }  } 

can you please help me to resolve this issue

I am trying to get Video Data but some "Metrics" data I can't get. So please help me with that?

$query = "SELECT campaign.id, ad_group.id, ad_group.name, metrics.impressions, metrics.video_views, metrics.clicks, metrics.video_view_rate, metrics.average_cpv, metrics.cost_micros, metrics.video_quartile_p25_rate, metrics.video_quartile_p50_rate, metrics.video_quartile_p75_rate, metrics.video_quartile_p100_rate, ad_group.status FROM ad_group WHERE ad_group.id IN (11111222233)";         // Issues a search request by specifying page size.         $response = $googleAdsServiceClient->search($customerId, $query, ['pageSize' => self::PAGE_SIZE]);         // Iterates over all rows in all pages and prints the requested field values for each row.         foreach ($response->iterateAllElements() as $googleAdsRow) {             /** @var GoogleAdsRow $googleAdsRow */             printf(                 "Ad group ID %d in campaign ID %d group Status %d Impressions %d clicks %d video_view %d video_view_rate %d average_cpv %d cost_micros %d video_quartile_p25_rate %d video_quartile_p50_rate %d video_quartile_p75_rate %d video_quartile_p100_rate %d ",                 $googleAdsRow->getAdGroup()->getId(),                 $googleAdsRow->getCampaign()->getId(),                 $googleAdsRow->getAdGroup()->getStatus(),                 $googleAdsRow->getMetrics()->getImpressions(),                 $googleAdsRow->getMetrics()->getClicks(),                 $googleAdsRow->getMetrics()->getVideoViews(),                 $googleAdsRow->getMetrics()->getVideoViewRate(),                 $googleAdsRow->getMetrics()->getAverageCpv(),                 $googleAdsRow->getMetrics()->getCostMicros(),                 $googleAdsRow->getMetrics()->getVideoQuartileP25Rate(),                 $googleAdsRow->getMetrics()->getVideoQuartileP50Rate(),                 $googleAdsRow->getMetrics()->getVideoQuartileP75Rate(),                 $googleAdsRow->getMetrics()->getVideoQuartileP100Rate(),                 PHP_EOL             ); 

OUTPUT IS:

Ad group ID 11111222233 in campaign ID 11111222233 group Status 3 Impressions 10552 clicks 2 video_view 6225 video_view_rate 0 average_cpv 20862 cost_micros 129871561 video_quartile_p25_rate 0 video_quartile_p50_rate 0 video_quartile_p75_rate 0 video_quartile_p100_rate 0

I need video_view_rate, video_quartile_p25_rate, video_quartile_p50_rate, video_quartile_p75_rate, video_quartile_p100_rate

I am attempting to use the Meta WhatsApp business API found here: https://developers.facebook.com/docs/whatsapp/cloud-api/overview

Everything has been setup correctly as far as I can tell as I am able to send template messages with my ACCESS_TOKEN and my FROM_PHONE_NUMBER_ID to my mobile using the below:

curl -i -X POST \   https://graph.facebook.com/v14.0/FROM_PHONE_NUMBER_ID/messages \   -H 'Authorization: Bearer ACCESS_TOKEN' \   -H 'Content-Type: application/json' \   -d '{ "messaging_product": "whatsapp", "to": "MY_MOBILE", "type": "template", "template": { "name": "hello_world", "language": { "code": "en_US" } } }' 

I would now like to send a free form text message by using the example given on the above link. The example is:

curl -X POST \   'https://graph.facebook.com/v14.0/FROM_PHONE_NUMBER_ID/messages' \   -H "Authorization: ACCESS_TOKEN" \   -d '{     "messaging_product": "whatsapp",     "to": "1650XXXXXXX",     "text": {"body" : "hi"}    }' 

I use:

curl -X POST \   'https://graph.facebook.com/v14.0/MY_FROM_PHONE_NUMBER_ID/messages' \   -H "Authorization: ACCESS_TOKEN" \   -d '{     "messaging_product": "whatsapp",     "to": "MY_MOBILE",     "text": {"body" : "hi"}    }' 

This returns a valid message id with no errors however the message is never received.

Some confusing points to note: Why is there no 'Bearer' directive in the ACCESS_TOKEN, it is required for the template call. ( I have tried with and without )? Why does the example show 1650XXXXXX as the mobile number, surely it's just an example but why put the 1650 there in the first place!!! ?