Skip to content

Commit 8d11de8

Browse files
committed
AdWords U2 Release
1 parent 3c17043 commit 8d11de8

20 files changed

+125
-37
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
3.1.1 - 2/25/2015
2+
* Added new example for migrating to Upgraded URLS.
3+
* Updated examples to reference final URLs.
4+
15
3.1.0 - 2/17/2015
26
* Added support for v201502 for the DoubleClick for Publishers Client Library.
37
* Removing support for v201311, v201308, and v201306.

examples/adwords/v201406/advanced_operations/add_text_ad_with_upgraded_urls.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
"""This examples adds a text add that uses upgraded URLs.
1818
19-
This will only work if your account is a test account or is whitelisted for this
20-
feature.
21-
2219
The LoadFromStorage method is pulling credentials and properties from a
2320
"googleads.yaml" file. By default, it looks for this file in your home
2421
directory. For more information, see the "Caching authentication information"
@@ -49,7 +46,7 @@ def main(client, adgroup_id):
4946
'displayUrl': 'www.example.com',
5047
# Specify a tracking URL for 3rd party tracking provider. You may specify
5148
# one at customer, campaign, ad group, ad, criterion or feed item levels.
52-
'trackingUrlTemplate': ('http://tracker.example.com/?cid={_season}'
49+
'trackingUrlTemplate': ('http://tracker.example.com/?season={_season}'
5350
'&promocode={_promocode}&u={lpurl}'),
5451
'urlCustomParameters': {
5552
'parameters': [

examples/adwords/v201409/advanced_operations/add_ad_customizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ def main(client, adgroups):
216216
'headline': 'Luxury Cruise to {=%s.Name}' % FEEDNAME,
217217
'description1': 'Only {=%s.Price}' % FEEDNAME,
218218
'description2': 'Offer ends in {=countdown(%s.Date)}!' % FEEDNAME,
219-
'url': 'http://www.example.com',
219+
'finalUrls': ['http://www.example.com'],
220220
'displayUrl': 'www.example.com'
221221
}
222222

examples/adwords/v201409/advanced_operations/add_click_to_download_ad.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ def main(client, ad_group_id):
8080
'xsi_type': 'TemplateAd',
8181
'name': 'Ad for demo game',
8282
'templateId': '353',
83-
'url': ('http://play.google.com/store/apps/details?'
84-
'id=com.example.demogame'),
83+
'finalUrls': [
84+
'http://play.google.com/store/apps/details?id=com.example.demogame'
85+
],
8586
'displayUrl': 'play.google.com',
8687
'templateElements': [ad_data]
8788
}
@@ -102,7 +103,7 @@ def main(client, ad_group_id):
102103
if 'value' in ads:
103104
for ad in ads['value']:
104105
print ('Added new click-to-download ad to ad group ID \'%s\' '
105-
'with URL \'%s\'.' % (ad['ad']['id'], ad['ad']['url']))
106+
'with URL \'%s\'.' % (ad['ad']['id'], ad['ad']['finalUrls'][0]))
106107
else:
107108
print 'No ads were added.'
108109

examples/adwords/v201409/advanced_operations/add_site_links.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# https://developers.google.com/adwords/api/docs/appendix/placeholders.html
3939
PLACEHOLDER_SITELINKS = '1'
4040
PLACEHOLDER_FIELD_SITELINK_LINK_TEXT = '1'
41-
PLACEHOLDER_FIELD_SITELINK_LINK_URL = '2'
41+
PLACEHOLDER_FIELD_SITELINK_FINAL_URL = '5'
4242
PLACEHOLDER_FIELD_LINE_1_TEXT = '3'
4343
PLACEHOLDER_FIELD_LINE_2_TEXT = '4'
4444

@@ -61,7 +61,7 @@ def main(client, campaign_id):
6161
'name': 'Feed For Site Links #%s' % uuid.uuid4(),
6262
'attributes': [
6363
{'type': 'STRING', 'name': 'Link Text'},
64-
{'type': 'URL', 'name': 'Link URL'},
64+
{'type': 'URL_LIST', 'name': 'Link Final URLs'},
6565
{'type': 'STRING', 'name': 'Line 1 Description'},
6666
{'type': 'STRING', 'name': 'Line 2 Description'}
6767
]
@@ -70,21 +70,22 @@ def main(client, campaign_id):
7070
response = feed_service.mutate([
7171
{'operator': 'ADD', 'operand': site_links_feed}
7272
])
73+
7374
if 'value' in response:
7475
feed = response['value'][0]
7576
link_text_feed_attribute_id = feed['attributes'][0]['id']
76-
link_url_feed_attribute_id = feed['attributes'][1]['id']
77+
final_url_feed_attribute_id = feed['attributes'][1]['id']
7778
line_1_feed_attribute_id = feed['attributes'][2]['id']
7879
line_2_feed_attribute_id = feed['attributes'][3]['id']
7980
print ('Feed with name \'%s\' and ID \'%s\' was added with' %
8081
(feed['name'], feed['id']))
81-
print ('\tText attribute ID \'%s\' and URL attribute ID \'%s\'.' %
82-
(link_text_feed_attribute_id, link_url_feed_attribute_id))
82+
print ('\tText attribute ID \'%s\' and Final URL attribute ID \'%s\'.' %
83+
(link_text_feed_attribute_id, final_url_feed_attribute_id))
8384
print ('\tLine 1 attribute ID \'%s\' and Line 2 attribute ID \'%s\'.' %
8485
(line_1_feed_attribute_id, line_2_feed_attribute_id))
8586
sitelinks_data['feedId'] = feed['id']
8687
sitelinks_data['linkTextFeedId'] = link_text_feed_attribute_id
87-
sitelinks_data['linkUrlFeedId'] = link_url_feed_attribute_id
88+
sitelinks_data['finalUrlFeedId'] = final_url_feed_attribute_id
8889
sitelinks_data['line1FeedId'] = line_1_feed_attribute_id
8990
sitelinks_data['line2FeedId'] = line_2_feed_attribute_id
9091
else:
@@ -116,7 +117,7 @@ def main(client, campaign_id):
116117
'stringValue': item['text']
117118
},
118119
{
119-
'feedAttributeId': sitelinks_data['linkUrlFeedId'],
120+
'feedAttributeId': sitelinks_data['finalUrlFeedId'],
120121
'stringValue': item['url']
121122
},
122123
{
@@ -164,10 +165,10 @@ def main(client, campaign_id):
164165
'feedAttributeId': sitelinks_data['linkTextFeedId'],
165166
'fieldId': PLACEHOLDER_FIELD_SITELINK_LINK_TEXT
166167
},
167-
{
168-
'feedAttributeId': sitelinks_data['linkUrlFeedId'],
169-
'fieldId': PLACEHOLDER_FIELD_SITELINK_LINK_URL
170-
},
168+
#{
169+
# 'feedAttributeId': sitelinks_data['finalUrlFeedId'],
170+
# 'fieldId': PLACEHOLDER_FIELD_SITELINK_FINAL_URL
171+
#},
171172
{
172173
'feedAttributeId': sitelinks_data['line1FeedId'],
173174
'fieldId': PLACEHOLDER_FIELD_LINE_1_TEXT

examples/adwords/v201409/advanced_operations/add_text_ad_with_upgraded_urls.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
"""This examples adds a text add that uses upgraded URLs.
18-
19-
This will only work if your account is a test account or is whitelisted for this
20-
feature.
17+
"""This example adds a text add that uses advanced features of upgraded URLS.
2118
2219
The LoadFromStorage method is pulling credentials and properties from a
2320
"googleads.yaml" file. By default, it looks for this file in your home
@@ -49,7 +46,7 @@ def main(client, adgroup_id):
4946
'displayUrl': 'www.example.com',
5047
# Specify a tracking URL for 3rd party tracking provider. You may specify
5148
# one at customer, campaign, ad group, ad, criterion or feed item levels.
52-
'trackingUrlTemplate': ('http://tracker.example.com/?cid={_season}'
49+
'trackingUrlTemplate': ('http://tracker.example.com/?season={_season}'
5350
'&promocode={_promocode}&u={lpurl}'),
5451
'urlCustomParameters': {
5552
'parameters': [

examples/adwords/v201409/basic_operations/add_keywords.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ def main(client, ad_group_id):
5252
},
5353
# These fields are optional.
5454
'userStatus': 'PAUSED',
55-
'destinationUrl': 'http://example.com/mars'
55+
'finalUrls': {
56+
'urls': ['http://example.com/mars']
57+
}
5658
}
5759

5860
keyword2 = {

examples/adwords/v201409/basic_operations/add_text_ads.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def main(client, ad_group_id):
5757
'adGroupId': ad_group_id,
5858
'ad': {
5959
'xsi_type': 'TextAd',
60-
'url': 'http://www.example.com',
60+
'finalUrls': ['http://www.example.com'],
6161
'displayUrl': 'example.com',
6262
'description1': 'Visit the Red Planet in style.',
6363
'description2': 'Low-gravity fun for everyone!',
@@ -74,7 +74,7 @@ def main(client, ad_group_id):
7474
'adGroupId': ad_group_id,
7575
'ad': {
7676
'xsi_type': 'TextAd',
77-
'url': 'http://www.example.com',
77+
'finalUrls': ['http://www.example.com'],
7878
'displayUrl': 'example.com',
7979
'description1': 'Enjoy your stay at Red Planet.',
8080
'description2': 'Buy your tickets now!',

examples/adwords/v201409/campaign_management/set_ad_parameters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ def main(client, ad_group_id, criterion_id):
5151
'adGroupId': ad_group_id,
5252
'ad': {
5353
'xsi_type': 'TextAd',
54-
'url': 'http://www.example.com',
54+
'finalUrls': {
55+
'urls': ['http://www.example.com']
56+
},
5557
'displayUrl': 'example.com',
5658
'description1': 'Low-gravity fun for {param1:cheap}.',
5759
'description2': 'Only {param2:a few} seats left!',

examples/adwords/v201409/campaign_management/validate_text_ad.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def main(client, ad_group_id):
4949
'adGroupId': ad_group_id,
5050
'ad': {
5151
'xsi_type': 'TextAd',
52-
'url': 'http://www.example.com',
52+
'finalUrls': {
53+
'urls': ['http://www.example.com']
54+
},
5355
'displayUrl': 'example.com',
5456
'description1': 'Visit the Red Planet in style.',
5557
'description2': 'Low-gravity fun for everyone!',

0 commit comments

Comments
 (0)