Can AdId be reused to copy over ads across adgroup?

24 views
Skip to first unread message

Stella

unread,
Feb 21, 2019, 3:08:54 AM2/21/19
to AdWords API and Google Ads API Forum
hi,
I am trying to migrate TextAd from one adgroup to another adgroup in the same campaign. Trying to figure out if there is any easy way to do that, other than copy over all values in TextAd.

I saw some related discussion on "Ids and mutating ads”, it seems when cloning camapign, a AdId can be reused. So wonder if anyway to reuse ad (by calling AdId) ?
Given (AdGroupIdAdId) pair is globally unique, can I ‘ADD' an ad by AdId to an existing AdGroupId?

Thanks!

googleadsapi...@google.com

unread,
Feb 21, 2019, 2:55:40 PM2/21/19
to AdWords API and Google Ads API Forum
Hello,

Unfortunately, it is not possible via API. But I will share your interest with the team to see if that may be possible to implement in the future releases. Meanwhile you could keep an eye on our blog for information related to the future releases.

Regards,
Sai Teja, AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_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/

Yang Yang

unread,
Feb 22, 2019, 1:11:39 PM2/22/19
to googleadsapi...@google.com, AdWords API and Google Ads API Forum
hi Sai,
This is the email reply to all, I have another replied to you separately yesterday with company related information.

Ok, now I am constructing a list of operand dictionary, and have a question of  uploading it. 

Demo in git for basica operation works for me.
operations_ddgroupad_single = [{
  'operator': 'ADD',
'operand': {
'xsi_type': 'AdGroupAd',
'adGroupId': dest_adgroup_id,
'ad': {'xsi_type': 'ExpandedTextAd',
'headlinePart1': 'Cruise #%s to Mars'% str(uuid.uuid4())[:8],
'headlinePart2': 'Best Space Cruise Line',
'headlinePart3': 'For Your Loved Ones',
'description': 'Buy your tickets now!',
'description2': 'Discount ends soon',
'finalUrls': ['http://www.example.com'],
},
'status': 'PAUSED'
}
}]
# BELOW WORKED
ad_single = ad_group_ad_service.mutate(operations_ddgroupad_single)[
'value']

 But when gernalizing it to makemore fields according to adgroupad operand ==>ExpandedTextAd it fails,  pls see my attached soap file. 

Can you let me know the correct syntax of adding values to all these keys below? I have reply you with the dest_adgroup_id and soap file for bug separatly.

operations_ddgroupad_single = [{
'operator': 'ADD',
'operand': {
'xsi_type': 'AdGroupAd',
'adGroupId': dest_adgroup_id,
'ad': {
'xsi_type': 'ExpandedTextAd',
'url': None,
'displayUrl': None,
'finalUrls': ['http://www.example.com'],
'finalMobileUrls': [],
'finalAppUrls': [],
'trackingUrlTemplate': None,
'finalUrlSuffix': None,
'urlCustomParameters': None,
'urlData': [],
'automated': False,
'type': 'EXPANDED_TEXT_AD',
'devicePreference': None,
'systemManagedEntitySource': None,
# 'Ad.Type': 'ExpandedTextAd',
'headlinePart1': cruise',
'headlinePart2': mars',
'headlinePart2': None,
'description': check this trip ',
'path1': None,
'path2': None

}
,
'status': 'PAUSED'
}
}]

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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...@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 a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/ityc-5l8D40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@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/00d12jhi98000000ola4oi001adefez74mj4d1g74o30c1g68qj6dpj%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

googleadsapi...@google.com

unread,
Feb 22, 2019, 3:08:30 PM2/22/19
to AdWords API and Google Ads API Forum
Hello Yang,

Looks like on your second screenshot you are passing headlinePart2 a second time with no value which caused the operations to fail. Please note that while adding the ExpandedTextAds headlinePart1, headlinePart2, Description and FinalUrls are mandatory fields. You could refer our client library example to add ExpandedTextAds. Please let me know if you have any further questions. 


Regards,
Sai Teja, AdWords API Team

Yang Yang

unread,
Feb 22, 2019, 7:20:02 PM2/22/19
to googleadsapi...@google.com, AdWords API and Google Ads API Forum
hi Sai, yes, I was trying to follow the example file on git. 
But still get this error, headlinePart2 is a typo. But looks there is more things here, the KeyError starts from ‘headlinePart1’. I will reply you separately with actual code and soap file. Thank you. 


Traceback (most recent call last):
  File "/Users/stellayang/Library/Python/3.6/lib/python/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-76-046e583b84fd>", line 2, in <module>
    ads_uploaded = ad_group_ad_service.mutate(add_adgroup_operations)['value']
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1374, in MakeSoapRequest
    packed_args = self._PackArguments(method_name, args)
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1232, in _PackArguments
    for ((_, param), param_data) in zip(op_params, args)]
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1232, in <listcomp>
    for ((_, param), param_data) in zip(op_params, args)]
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1287, in _PackArgumentsHelper
    for item in data]
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1287, in <listcomp>
    for item in data]
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1277, in _PackArgumentsHelper
    elem_type, type_override is not None, data_formatted, set_type_attrs)
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in _CreateComplexTypeFromData
    for k, v in data if k != 'xsi_type'}
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in <dictcomp>
    for k, v in data if k != 'xsi_type'}
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1277, in _PackArgumentsHelper
    elem_type, type_override is not None, data_formatted, set_type_attrs)
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in _CreateComplexTypeFromData
    for k, v in data if k != 'xsi_type'}
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in <dictcomp>
    for k, v in data if k != 'xsi_type'}
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1277, in _PackArgumentsHelper
    elem_type, type_override is not None, data_formatted, set_type_attrs)
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in _CreateComplexTypeFromData
    for k, v in data if k != 'xsi_type'}
  File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1344, in <dictcomp>
    for k, v in data if k != 'xsi_type'}
KeyError: 'headlinePart1'

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

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...@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 a topic in the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-api/ityc-5l8D40/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
Message has been deleted

googleadsapi...@google.com

unread,
Feb 25, 2019, 11:07:07 AM2/25/19
to AdWords API and Google Ads API Forum
Hello Yang,

You could refer here to see all the required and the acceptable inputs for the fields for ExpandedTextAds. You could share the SOAP logs by using reply privately to the author option on this thread. You could refer here to enable logging.


Regards,
Sai Teja, AdWords API Team
Reply all
Reply to author
Forward
0 new messages