Hi guys,
I need to build a script, that takes all sitelink-extensions of a defined
campaign, check their attributes for occurance of a list of Stopwords an
remove the sitelink, if one stopword occurs in the sitelink extension.
First Step: I select the sitelink-extensions of the campaign.
extension_type_enum = self.__google_ads_client.enums.ExtensionTypeEnum
extension_type_name = extension_type_enum.SITELINK.name
campaign_resource_name =
self.__google_ads_client.get_service("CampaignService").campaign_path(self.account_id,
str(row_campaign.campaign.id))
query = f"""
SELECT
campaign_extension_setting.campaign,
campaign_extension_setting.extension_type,
campaign_extension_setting.extension_feed_items
FROM campaign_extension_setting
WHERE
campaign_extension_setting.campaign = '{campaign_resource_name}'
AND campaign_extension_setting.extension_type = '{extension_type_name}'"""
stream = self.__customer_service.search_stream(customer_id=self.account_id,
query=query)
extension_feed_item_resource_names = []
for batch in stream:
for row in batch.results:
extension_feed_item_resource_names.extend(
row.campaign_extension_setting.extension_feed_items
)
This is working very well. I get all the feed item ressource names of my
sitelinks.
The point where i struggle is to get the extension_feed_item by this
ressource names. Can anyone help me out? I need to get the
extension_feed_item, so i can check the attributes against my Stoplist.
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/fc7d9346-0f64-4d41-8087-4ef42fad164fn%40googlegroups.com.