RE: Ads API to get headline+description of different ad types

2021-09-01 Thread Google Ads API Forum Advisor
Hi Elad,

Thank you for reaching out to our API support team.

You are correct that you should use the ad_group_ad report in fetching specific 
ad details. However, as it seems that you wish to clarify a code or client 
library level solution, I would recommend that you reach out to the client 
library owners instead, via this link, for further guidance.

Best regards,

Peter Laurence Napa Oliquino
Google Ads API Team
ref:_00D1U1174p._5004Q2MkUCa: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 
"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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/CxKHi0QYQTSH008SElJu0wSfSzNe6hgTQKUQ%40sfdc.net.


Re: Ads API to get headline+description of different ad types

2021-08-31 Thread Mhmoudahmdmohmmd homydt
653

في الأربعاء، 1 سبتمبر، 2021 2:54 ص Mhmoudahmdmohmmd homydt <
mhmoudahmdmohmmdhom...@gmail.com> كتب:

>
>
> 653
>
> في الأربعاء، 1 سبتمبر، 2021 2:33 ص 'EladB' via AdWords API and Google Ads
> API Forum  كتب:
>
>> Hi esteemed,
>>
>> I want to audit the mandatory fields of a few ads from different types
>> (text ads, extended-text ads, responsive text ads).
>>
>> How would you do this (python 3.8 compatible)?
>>
>> I see my select clause should fetch a few fields. How would you switch
>> case the ad type while making sure my code resilient for cases when the
>> `yaml` file doesn't contain `Proto-plus = True` (for enum names: [one
>> ],
>> [two
>> 
>> ])
>>
>>
>> Thanks!
>>
>> My code:
>>
>> query = f"""
>> SELECT
>>   customer.id,
>>   campaign.id,
>>   ad_group_ad.ad.type,
>>   ad_group_ad.ad.text_ad.headline,
>>   ad_group_ad.ad.text_ad.description1,
>>   ad_group_ad.ad.text_ad.description2,
>>
>>   ad_group_ad.ad.expanded_text_ad.headline_part1,
>>   ad_group_ad.ad.expanded_text_ad.headline_part2,
>>   ad_group_ad.ad.expanded_text_ad.headline_part3,
>>
>>   ad_group_ad.ad.responsive_search_ad.headlines,
>>   ad_group_ad.ad.responsive_search_ad.descriptions,
>>   ad_group_ad.ad.responsive_search_ad.path1,
>>   ad_group_ad.ad.responsive_search_ad.path2,
>>
>>   ad_group_ad.ad.id,
>>   ad_group_ad.ad.type,
>>   ad_group_ad.ad_group,
>>   ad_group_ad.policy_summary.approval_status,
>>   ad_group_ad.policy_summary.policy_topic_entries
>> FROM ad_group_ad
>> WHERE
>> ad_group_ad.policy_summary.approval_status = DISAPPROVED"""
>>
>> customer_id = account["id"]
>> rows = serviceWrapper.get_rows(customer_id, query)
>> for row in rows:
>> ad_group_ad = row.ad_group_ad
>> ad = ad_group_ad.ad
>> if ad.type_.name.upper() == "TEXT_AD":
>> print(
>> f'\tad.text_ad.headline: "{ad.text_ad.headline}",
>> desc1: "{ad.text_ad.description1}", '
>> f'desc2: "{ad.text_ad.description2}"')
>> elif ad.type_.name.upper() == "EXPANDED_TEXT_AD":
>> print(
>> f'\tad.expanded_text_ad.headline_part1:
>> "{ad.expanded_text_ad.headline_part1}",
>> ad_group_ad.ad.expanded_text_ad.headline_part1:
>> "{ad_group_ad.ad.expanded_text_ad.headline_part1}", '
>> f'ad_group_ad.ad.expanded_text_ad.headline_part2:
>> "{ad_group_ad.ad.expanded_text_ad.headline_part2}"')
>> elif ad.type_.name.upper() == "RESPONSIVE_SEARCH_AD":
>> print(
>> f'\tad_group_ad.ad.responsive_search_ad.headlines:
>> "{ad_group_ad.ad.responsive_search_ad.headlines}",
>> ad_group_ad.ad.responsive_search_ad.descriptions:
>> "{ad_group_ad.ad.responsive_search_ad.descriptions}", '
>> f'ad_group_ad.ad.responsive_search_ad.path1:
>> "{ad_group_ad.ad.responsive_search_ad.path1}",
>> ad_group_ad.ad.responsive_search_ad.path2:
>> "{ad_group_ad.ad.responsive_search_ad.path2}"')
>>
>> --
>> --
>> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
>> 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
>> "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+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/adwords-api/4508bfa9-01b1-4674-a700-f97786f86964n%40googlegroups.com
>> 
>> .
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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

Re: Ads API to get headline+description of different ad types

2021-08-31 Thread Mhmoudahmdmohmmd homydt
653

في الأربعاء، 1 سبتمبر، 2021 2:33 ص 'EladB' via AdWords API and Google Ads
API Forum  كتب:

> Hi esteemed,
>
> I want to audit the mandatory fields of a few ads from different types
> (text ads, extended-text ads, responsive text ads).
>
> How would you do this (python 3.8 compatible)?
>
> I see my select clause should fetch a few fields. How would you switch
> case the ad type while making sure my code resilient for cases when the
> `yaml` file doesn't contain `Proto-plus = True` (for enum names: [one
> ],
> [two
> 
> ])
>
>
> Thanks!
>
> My code:
>
> query = f"""
> SELECT
>   customer.id,
>   campaign.id,
>   ad_group_ad.ad.type,
>   ad_group_ad.ad.text_ad.headline,
>   ad_group_ad.ad.text_ad.description1,
>   ad_group_ad.ad.text_ad.description2,
>
>   ad_group_ad.ad.expanded_text_ad.headline_part1,
>   ad_group_ad.ad.expanded_text_ad.headline_part2,
>   ad_group_ad.ad.expanded_text_ad.headline_part3,
>
>   ad_group_ad.ad.responsive_search_ad.headlines,
>   ad_group_ad.ad.responsive_search_ad.descriptions,
>   ad_group_ad.ad.responsive_search_ad.path1,
>   ad_group_ad.ad.responsive_search_ad.path2,
>
>   ad_group_ad.ad.id,
>   ad_group_ad.ad.type,
>   ad_group_ad.ad_group,
>   ad_group_ad.policy_summary.approval_status,
>   ad_group_ad.policy_summary.policy_topic_entries
> FROM ad_group_ad
> WHERE
> ad_group_ad.policy_summary.approval_status = DISAPPROVED"""
>
> customer_id = account["id"]
> rows = serviceWrapper.get_rows(customer_id, query)
> for row in rows:
> ad_group_ad = row.ad_group_ad
> ad = ad_group_ad.ad
> if ad.type_.name.upper() == "TEXT_AD":
> print(
> f'\tad.text_ad.headline: "{ad.text_ad.headline}",
> desc1: "{ad.text_ad.description1}", '
> f'desc2: "{ad.text_ad.description2}"')
> elif ad.type_.name.upper() == "EXPANDED_TEXT_AD":
> print(
> f'\tad.expanded_text_ad.headline_part1:
> "{ad.expanded_text_ad.headline_part1}",
> ad_group_ad.ad.expanded_text_ad.headline_part1:
> "{ad_group_ad.ad.expanded_text_ad.headline_part1}", '
> f'ad_group_ad.ad.expanded_text_ad.headline_part2:
> "{ad_group_ad.ad.expanded_text_ad.headline_part2}"')
> elif ad.type_.name.upper() == "RESPONSIVE_SEARCH_AD":
> print(
> f'\tad_group_ad.ad.responsive_search_ad.headlines:
> "{ad_group_ad.ad.responsive_search_ad.headlines}",
> ad_group_ad.ad.responsive_search_ad.descriptions:
> "{ad_group_ad.ad.responsive_search_ad.descriptions}", '
> f'ad_group_ad.ad.responsive_search_ad.path1:
> "{ad_group_ad.ad.responsive_search_ad.path1}",
> ad_group_ad.ad.responsive_search_ad.path2:
> "{ad_group_ad.ad.responsive_search_ad.path2}"')
>
> --
> --
> =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
> 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
> "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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/adwords-api/4508bfa9-01b1-4674-a700-f97786f86964n%40googlegroups.com
> 
> .
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving