Posts tagged with google-ads-api

I try to make a keyword searches system for our employ and i have google ads developer token But I cannot able to find any CURL or PHP CURL setup guide.

Two reference links Ad API Examples
Method: customers.generateKeywordIdeas

An example from Google's documentation:

curl -f --request POST "https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/campaignBudgets:mutate" \ --header "Content-Type: application/json" \ --header "developer-token: ${DEVELOPER_TOKEN}" \ --header "login-customer-id: ${MANAGER_CUSTOMER_ID}" \ --header "Authorization: Bearer ${OAUTH2_ACCESS_TOKEN}" \ --data "{ 'operations': [   {     'create': {       'name': 'My Campaign Budget #${RANDOM}',       'amountMicros': 500000,     }   },   {     'create': {       'name': 'My Campaign Budget #${RANDOM}',       'amountMicros': 500000,     }   } ] }" 

I try this code but got Error

    <?          $ch = curl_init();          curl_setopt($ch, CURLOPT_URL, 'https://googleads.googleapis.com/v11/customers/(MANAGER_CUSTOMER_ID):generateKeywordIdeas');     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);     curl_setopt($ch, CURLOPT_POST, 1);     curl_setopt($ch, CURLOPT_POSTFIELDS, "{\n\n\"keywordSeed\": {\n    \"keywords\": [\n    \"cofee\"\n  ]\n  }\n}");          $headers = array();     $headers[] = 'Content-Type: application/json';     $headers[] = 'Login-Customer-Id: (MANAGER_CUSTOMER_ID)';     $headers[] = 'Developer-Token: DEVELOPER_TOKEN';     $headers[] = 'Authorization: Bearer (OAUTH_ACCESS_TOKEN)';     curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);          $result = curl_exec($ch);     if (curl_errno($ch)) {         echo 'Error:' . curl_error($ch);     }     print_r($result);     curl_close($ch); 

I'm not getting any output

Good morning i having a problem with google Ads api. I am coding with .net environment with client library provided by google and i followed the documentation on google site to configure api request to create campaign, group and ads automatically. I did a simple test site to test api but execution stops or better never stop but it seems in a infinite loop after call of line:

  MutateCampaignBudgetsResponse response = budgetService.MutateCampaignBudgets(customerId.ToString(), new CampaignBudgetOperation[] { budgetOperation }); 

I can't solve this problem because no exception or error is thrown. This is the link of google documentation i have followed: https://developers.google.com/google-ads/api/docs/start Thank you

I see there is a REST API for blocking placements at a customer level.

But I cannot find if there is an API (preferably REST) for blocking at an ad-group level.

Is it only possible to remove an existing placement, but not blocking for the future as well (like possible at an account level)?

Blocking at an account level ("NegativeCriteria"): https://developers.google.com/google-ads/api/rest/reference/rest/v10/customers.customerNegativeCriteria/mutate

I'm building a game in Unity that uses AdMob ads. In the app I only have one screen (a map with objects). I want to add a rewarded ad to 1) speed up an upgrade 2) unlock boosters. They all are on one map (one activity). In this case should I use 2 ad units or only a single is ok? I am aware that I should use one ad unit per activity but how does it apply to my case?

** can google punish me (make some limits) for too many requests if I use more (10+) ad units in one screen?

Recently I have been trying to create a script to retrieve either an accounts or individual campaigns optimisation scores and subsequently send a email including this. My problem is that I cannot find optimisation score in stats or metrics anyway I try.

Does anyone know if this is even a retrievable variable in scripts?