Re: get customer id - php v13 google ads

2023-05-05 Thread Jessica Villa
If I put the manager id as param of searchStream I got an empty result but 
no errors...

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
$query = "SELECT customer.id, customer.descriptive_name, ad_group.id, 
ad_group.name FROM ad_group WHERE ad_group.id = AD_GROUP_ID LIMIT 1";
$response = $googleAdsServiceClient->searchStream('MANAGER_ACCOUNT_ID' 
$query); // is this line right?

foreach ($response->iterateAllElements() as $googleAdsRow) {
$customers[] = [
'customer_client.id' => $googleAdsRow->getCustomerClient()->getId(),
];
}

is there any function where customer id don't need to be required in order 
to get the customer id?

Thank you again!
On Friday, May 5, 2023 at 11:41:28 AM UTC-6 Jessica Villa wrote:

> Thank you for your answer, I have other question:
> using the function *search() * or *searchStream()* is the right way to 
> retrieve info?
>
> $googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
> $query = "SELECT customer.id, customer.descriptive_name, ad_group.id, 
> ad_group.name FROM ad_group WHERE ad_group.id = AD_GROUP_ID LIMIT 1";
> $response = $googleAdsServiceClient->searchStream('' $query); // is 
> this line right?
>
> foreach ($response->iterateAllElements() as $googleAdsRow) {
> $customers[] = [
> 'customer_client.id' => $googleAdsRow->getCustomerClient()->getId(),
> ];
> }
>  because I got empty response... and maybe is another way to get the info.
>
> I don't have the customer_id value (so that's why I put '???' I don't know 
> exactly if I am using the right function), only I got ad_group_id value
>
> Thank you!
>
> On Friday, May 5, 2023 at 3:57:37 AM UTC-6 Google Ads API Forum Advisor 
> wrote:
>
>> Hi Jessica,
>>
>> Thank you for responding back with the additional context of your concern.
>>
>> As per your use case, customer is an attributed resources of ad_group 
>> report so you should be able to retrieve the customer fields from ad_group 
>> report. Here's an example query for your reference.
>>   
>>
>>
>> SELECT customer.id, customer.descriptive_name, ad_group.id, ad_group.name 
>> FROM ad_group WHERE ad_group.id = 'AD_YOUR_ADGROUP_ID_HERE'
>>
>>
>> Regards,
>>
>> [image: Google Logo] Google Ads API Team 
>>
>> ref:_00D1U1174p._5004Q2lA73z:ref
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bb252ba0-12ea-4371-a59f-2a61c49177a8n%40googlegroups.com.


Re: get customer id - php v13 google ads

2023-05-05 Thread Jessica Villa
Thank you for your answer, I have other question:
using the function *search() * or *searchStream()* is the right way to 
retrieve info?

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
$query = "SELECT customer.id, customer.descriptive_name, ad_group.id, 
ad_group.name FROM ad_group WHERE ad_group.id = AD_GROUP_ID LIMIT 1";
$response = $googleAdsServiceClient->searchStream('' $query); // is 
this line right?

foreach ($response->iterateAllElements() as $googleAdsRow) {
$customers[] = [
'customer_client.id' => $googleAdsRow->getCustomerClient()->getId(),
];
}
 because I got empty response... and maybe is another way to get the info.

I don't have the customer_id value (so that's why I put '???' I don't know 
exactly if I am using the right function), only I got ad_group_id value

Thank you!

On Friday, May 5, 2023 at 3:57:37 AM UTC-6 Google Ads API Forum Advisor 
wrote:

> Hi Jessica,
>
> Thank you for responding back with the additional context of your concern.
>
> As per your use case, customer is an attributed resources of ad_group 
> report so you should be able to retrieve the customer fields from ad_group 
> report. Here's an example query for your reference.
>   
>
>
> SELECT customer.id, customer.descriptive_name, ad_group.id, ad_group.name 
> FROM ad_group WHERE ad_group.id = 'AD_YOUR_ADGROUP_ID_HERE'
>
>
> Regards,
>
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2lA73z:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e79ae6b0-4a95-4585-b3ab-bdbd3ae69cccn%40googlegroups.com.


Re: get customer id - php v13 google ads

2023-05-05 Thread Jessica Villa
Thank you for your answer, I have other question:
using the function *search() * or *searchStream()* is the right way to 
retrieve info?

$googleAdsServiceClient = $googleAdsClient->getGoogleAdsServiceClient();
$query = "SELECT customer.id, customer.descriptive_name, ad_group.id, 
ad_group.name FROM ad_group WHERE ad_group.id = x LIMIT 1";
$response = $googleAdsServiceClient->searchStream('', $query); // 
is this line right?

foreach ($response->iterateAllElements() as $googleAdsRow) {
$customers[] = [
'customer_client.id' => $googleAdsRow->getCustomerClient()->getId(),
];
}
 because I got empty response... and maybe is another way to get the info.

Thank you!
On Friday, May 5, 2023 at 3:57:37 AM UTC-6 Google Ads API Forum Advisor 
wrote:

> Hi Jessica,
>
> Thank you for responding back with the additional context of your concern.
>
> As per your use case, customer is an attributed resources of ad_group 
> report so you should be able to retrieve the customer fields from ad_group 
> report. Here's an example query for your reference.
>   
>
>
> SELECT customer.id, customer.descriptive_name, ad_group.id, ad_group.name 
> FROM ad_group WHERE ad_group.id = 'AD_YOUR_ADGROUP_ID_HERE'
>
>
> Regards,
>
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2lA73z:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/31a040f2-2ef0-4dd4-a6ec-cd36caf80fd9n%40googlegroups.com.


Re: get customer id - php v13 google ads

2023-05-04 Thread Jessica Villa
The issue is not the log, is to know if there is possible to retrieve the 
*customer.id* having only the *ad_group_id*
doing the* $query* and using *search()* like this:
*$googleAdsServiceClient->search(**$query);*

or something, in the examples couldn't find something about it

Thank you!
On Thursday, May 4, 2023 at 4:36:19 AM UTC-6 Google Ads API Forum Advisor 
wrote:

> Hi Jessica*,*
>
> Thank you for reaching out to us.
>
> For our team to further check this and provide you with an appropriate 
> recommendation, could you please provide us with the complete API logs (
> *request* and *response* with *request-id*) generated on your end?
>
>- *request* : 
>
> *https://developers.google.com/google-ads/api/docs/concepts/field-service#request*
>  
>
> 
>  
>- *response*: 
>
> *https://developers.google.com/google-ads/api/docs/concepts/field-service#response*
>  
>
> 
>  
>- *request-id* : 
>
> *https://developers.google.com/google-ads/api/docs/concepts/call-structure#request-id*
>  
>
> 
>  
>
> Note that logs can be requested or provided to the developer handling the 
> Google Ads API transactions when logging of the API requests has been 
> enabled.
>
> This is the specific guideline to enable PHP: 
> *https://developers.google.com/google-ads/api/docs/client-libs/php/logging* 
> 
> You may then send the requested information via the Reply privately to 
> author option. If this option is not available, you may send the details 
> directly to our googleadsa...@google.com alias instead.
>
> Best regards,
> [image: Google Logo] Google Ads API Team 
>
> ref:_00D1U1174p._5004Q2lA73z:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/90de7689-f9f6-4d0c-9957-faafbd795655n%40googlegroups.com.


Get customer ID - PHP V13 Google Ads

2023-05-03 Thread Jessica Villa
Hello!

I have a question and hope someone can help me: how can I get the customer 
ID if I only have the ad_group_id?

I tried using this query: 
*$query = "SELECT customer.id FROM ad_group WHERE ad_group.id = 
".$ad_group_id." LIMIT 1";*

and accessing like this: *$googleAdsClient->getCustomerId()*

but my query is not successful, so is this the right way?

Note:
*$ad_group_id* is retrieved from an array so the query is dynamic, and the 
*customer 
id* too, so that's why I want to get the *customer id*.

I'm using php v13 of google ads.

Thanks!!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/12ac270c-4c56-4d19-a2f9-4a0c10a3c848n%40googlegroups.com.


Understand the values retrieved by the php api of google ads

2023-04-18 Thread Jessica Villa
Hello!
I hope someone can help me to understand this.

I have this query:

*SELECT** campaign.primary_status, *
* campaign.campaign_group, *
* metrics.cost_per_conversion, *
* campaign.name,*
* segments.date,*
* metrics.clicks,*
* metrics.cost_micros*
* FROM campaign WHERE segments.date DURING LAST_7_DAYS and campaign.id = 
xx*

and I get the data successfully but I notice this:

In the field *metrics.cost_per_conversion* I got in my *json response* (for 
example) a number like this:
*31334088.24578694*

and checking my *dashboard*, I have: *31.33*

*Comparison:*
*31334088.24578694 - **31.33*

Why happen this? Do I have to cast my data or something?
I'm using PHP Library.

Thanks!

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/e8c20cdb-f5ae-4e83-acec-7a840ce13173n%40googlegroups.com.