Need only customerID

136 views
Skip to first unread message

cv

unread,
Apr 12, 2019, 5:42:06 AM4/12/19
to AdWords API and Google Ads API Forum
Hello Team,

Is that possible to get only customerId without resourcenames?

Like From this resource name customers/8*******74, I only need to have 8*******74.

I know I can get using getCustomer(), but It is require lot of time as I have 500+ accounts under my MCC and I need to list them all.

$customer = $customerServiceClient->getCustomer($resourceName);
            $customerId = ($customer->getId()!='') ? $customer->getId()->getValue() : '';

Is directly possible to have customer info without needing any extra api calls?


Thanks,

googleadsapi...@google.com

unread,
Apr 12, 2019, 6:45:57 AM4/12/19
to adwor...@googlegroups.com, AdWords API and Google Ads API Forum
Hi,

If you only want to get all the customer IDs under a manager account, I would recommend to use the Account Performance Report and include the ExternalCustomerId field to your report.

Please let me know if you have further questions/clarifications.

Regards,
Ejay
Google Ads API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/c05b8dde-f032-4320-a6c6-0b3539e10639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

cv

unread,
Apr 12, 2019, 8:06:13 AM4/12/19
to AdWords API and Google Ads API Forum
Sorry, I forgot to mention, this error is for New Ads API.

I am getting those data using Adwords API. I was doing migration process from Adwords API to Google Ads API.

googleadsapi...@google.com

unread,
Apr 15, 2019, 1:45:42 AM4/15/19
to AdWords API and Google Ads API Forum
Hi,

Your concern was handed over to me as I am more capable of assisting you with Google Ads API related concerns. Unfortunately, in Google Ads API perspective, there is no direct way of returning the customerId value itself. You have to implement your own parsing function for the resource name value. 

Let me know if you have further clarifications.

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
Message has been deleted

cv

unread,
Apr 15, 2019, 5:38:23 AM4/15/19
to AdWords API and Google Ads API Forum
Ok,

So I need to use my logic to get onlyCustomerId from resourceNames.

I just want to know any API function that gives me resurceNames do have ny revrse capbility?

LIke forCustomer() does?

Thanks,

googleadsapi...@google.com

unread,
Apr 15, 2019, 6:31:31 AM4/15/19
to AdWords API and Google Ads API Forum
Hi,

The Id you specify in the login-customer-id is usually the root MCC in your account hierarchy. This will be able to grant access to all accounts under the MCC account (even sub-MCC, and client accounts). You can refer to this guide for further details.

For you concern about the customer Id, could you confirm if my understanding is correct? You wish to get all resource names in the Google Ads API that returns customer Id only? If this is what you meant, I am afraid that there is no such function supported in the Google Ads API. If I misunderstood your concern, could you further elaborate this so I could better assist you?

Regards,
Dannison
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

cv

unread,
Jun 19, 2019, 2:48:26 AM6/19/19
to AdWords API and Google Ads API Forum
Hello Dannison,

I mean here is I am getting different resource names with each search query depends on the nature of the query.

For example If I call the Adgroup Resource
I have this details customers/{customer_id}/adGroups/{ad_group_id}
I need customer_id

Same way If I call Customer client or customer resource I have this as resource name
customers/{customer_id}

customers/{customer_id}/customerClients/{client_customer_id}

How I can know which customer is called?

Is there any function which will read resource name and give me its values?

Thanks,

Google Ads API Forum Advisor Prod

unread,
Jun 19, 2019, 9:24:00 PM6/19/19
to adwor...@googlegroups.com
Hi,

I am afraid there is no function in the API that can read resource names. You have to implement your own parser if you wish to retrieve only the customer id. To understand more about resource names, you can refer to this guide.

Regards,
Dannison
Google Ads API Team

ref:_00D1U1174p._5001UBo8aI:ref
Reply all
Reply to author
Forward
0 new messages