google-adwords-api 0.9.3 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (213) hide show
  1. data/ChangeLog +4 -0
  2. data/README +4 -4
  3. data/examples/{v201209 → v201309}/account_management/create_account.rb +9 -1
  4. data/examples/{v201209 → v201309}/account_management/get_account_alerts.rb +9 -1
  5. data/examples/{v201209 → v201309}/account_management/get_account_changes.rb +9 -1
  6. data/examples/{v201209 → v201309}/account_management/get_account_hierarchy.rb +9 -1
  7. data/examples/v201309/advanced_operations/add_ad_group_bid_modifier.rb +105 -0
  8. data/examples/v201309/advanced_operations/add_click_to_download_ad.rb +137 -0
  9. data/examples/v201309/advanced_operations/add_site_links.rb +244 -0
  10. data/examples/v201309/advanced_operations/create_and_attach_shared_keyword_set.rb +147 -0
  11. data/examples/v201309/advanced_operations/find_and_remove_criteria_from_shared_set.rb +181 -0
  12. data/examples/{v201209/adwords_for_video/get_video_campaign_criteria.rb → v201309/advanced_operations/get_ad_group_bid_modifiers.rb} +30 -23
  13. data/examples/v201309/advanced_operations/upload_offline_conversions.rb +117 -0
  14. data/examples/v201309/advanced_operations/use_shared_bidding_strategy.rb +163 -0
  15. data/examples/{v201209 → v201309}/basic_operations/add_ad_groups.rb +28 -21
  16. data/examples/{v201209 → v201309}/basic_operations/add_campaigns.rb +18 -15
  17. data/examples/{v201209 → v201309}/basic_operations/add_keywords.rb +9 -1
  18. data/examples/{v201209 → v201309}/basic_operations/add_text_ads.rb +9 -1
  19. data/examples/{v201209 → v201309}/basic_operations/delete_ad.rb +9 -1
  20. data/examples/{v201209 → v201309}/basic_operations/delete_ad_group.rb +9 -1
  21. data/examples/{v201209 → v201309}/basic_operations/delete_campaign.rb +9 -1
  22. data/examples/{v201209 → v201309}/basic_operations/delete_keyword.rb +9 -1
  23. data/examples/{v201209 → v201309}/basic_operations/get_ad_groups.rb +9 -1
  24. data/examples/{v201209 → v201309}/basic_operations/get_campaigns.rb +9 -1
  25. data/examples/{v201209 → v201309}/basic_operations/get_campaigns_with_awql.rb +9 -1
  26. data/examples/{v201209 → v201309}/basic_operations/get_keywords.rb +9 -1
  27. data/examples/{v201209 → v201309}/basic_operations/get_text_ads.rb +9 -1
  28. data/examples/{v201209 → v201309}/basic_operations/pause_ad.rb +9 -1
  29. data/examples/{v201209 → v201309}/basic_operations/update_ad_group.rb +9 -1
  30. data/examples/{v201209 → v201309}/basic_operations/update_campaign.rb +9 -1
  31. data/examples/{v201209 → v201309}/basic_operations/update_keyword.rb +21 -10
  32. data/examples/{v201209 → v201309}/campaign_management/add_experiment.rb +9 -1
  33. data/examples/{v201209 → v201309}/campaign_management/add_keywords_in_bulk.rb +10 -2
  34. data/examples/{v201209 → v201309}/campaign_management/add_location_extension.rb +9 -1
  35. data/examples/{v201209 → v201309}/campaign_management/add_location_extension_override.rb +9 -1
  36. data/examples/{v201209 → v201309}/campaign_management/get_all_disapproved_ads.rb +21 -13
  37. data/examples/{v201209 → v201309}/campaign_management/get_all_disapproved_ads_with_awql.rb +17 -8
  38. data/examples/{v201209 → v201309}/campaign_management/promote_experiment.rb +9 -1
  39. data/examples/{v201209 → v201309}/campaign_management/set_ad_parameters.rb +9 -1
  40. data/examples/{v201209 → v201309}/campaign_management/set_criterion_bid_modifier.rb +11 -5
  41. data/examples/{v201209 → v201309}/campaign_management/validate_text_ad.rb +9 -1
  42. data/examples/{v201209 → v201309}/error_handling/handle_captcha_challenge.rb +1 -1
  43. data/examples/{v201209 → v201309}/error_handling/handle_partial_failures.rb +9 -1
  44. data/examples/{v201209 → v201309}/error_handling/handle_policy_violation_error.rb +9 -1
  45. data/examples/{v201209 → v201309}/error_handling/handle_two_factor_authorization_error.rb +1 -1
  46. data/examples/{v201209 → v201309}/misc/get_all_images_and_videos.rb +9 -1
  47. data/examples/{v201209/misc/use_oauth2.rb → v201309/misc/setup_oauth2.rb} +17 -26
  48. data/examples/{v201209 → v201309}/misc/upload_image.rb +9 -1
  49. data/examples/{v201209 → v201309}/misc/use_oauth2_jwt.rb +1 -1
  50. data/examples/{v201209 → v201309}/optimization/estimate_keyword_traffic.rb +9 -1
  51. data/examples/{v201209 → v201309}/optimization/get_keyword_bid_simulations.rb +9 -1
  52. data/examples/{v201209 → v201309}/optimization/get_keyword_ideas.rb +17 -1
  53. data/examples/{v201209 → v201309}/optimization/get_placement_ideas.rb +9 -1
  54. data/examples/{v201209 → v201309}/remarketing/add_audience.rb +11 -3
  55. data/examples/{v201209 → v201309}/remarketing/add_conversion_tracker.rb +9 -2
  56. data/examples/{v201209 → v201309}/reporting/download_criteria_report.rb +9 -1
  57. data/examples/{v201209 → v201309}/reporting/download_criteria_report_with_awql.rb +9 -1
  58. data/examples/{v201209 → v201309}/reporting/get_campaign_stats.rb +9 -1
  59. data/examples/{v201209 → v201309}/reporting/get_report_fields.rb +9 -1
  60. data/examples/{v201209 → v201309}/reporting/parallel_report_download.rb +9 -1
  61. data/examples/{v201209 → v201309}/targeting/add_campaign_targeting_criteria.rb +10 -5
  62. data/examples/{v201209 → v201309}/targeting/add_demographic_targeting_criteria.rb +9 -1
  63. data/examples/{v201209 → v201309}/targeting/get_campaign_targeting_criteria.rb +9 -1
  64. data/examples/{v201209 → v201309}/targeting/get_targetable_languages_and_carriers.rb +9 -1
  65. data/examples/{v201209 → v201309}/targeting/lookup_location.rb +9 -1
  66. data/lib/adwords_api/api_config.rb +57 -55
  67. data/lib/adwords_api/{v201209 → v201309}/ad_group_ad_service.rb +7 -7
  68. data/lib/adwords_api/v201309/ad_group_ad_service_registry.rb +46 -0
  69. data/lib/adwords_api/{v201209 → v201309}/ad_group_bid_modifier_service.rb +6 -6
  70. data/lib/adwords_api/v201309/ad_group_bid_modifier_service_registry.rb +46 -0
  71. data/lib/adwords_api/{v201209 → v201309}/ad_group_criterion_service.rb +7 -7
  72. data/lib/adwords_api/v201309/ad_group_criterion_service_registry.rb +46 -0
  73. data/lib/adwords_api/v201309/ad_group_feed_service.rb +38 -0
  74. data/lib/adwords_api/v201309/ad_group_feed_service_registry.rb +46 -0
  75. data/lib/adwords_api/{v201209 → v201309}/ad_group_service.rb +7 -7
  76. data/lib/adwords_api/v201309/ad_group_service_registry.rb +46 -0
  77. data/lib/adwords_api/{v201209 → v201309}/ad_param_service.rb +7 -7
  78. data/lib/adwords_api/v201309/ad_param_service_registry.rb +46 -0
  79. data/lib/adwords_api/v201309/adwords_user_list_service.rb +38 -0
  80. data/lib/adwords_api/v201309/adwords_user_list_service_registry.rb +46 -0
  81. data/lib/adwords_api/{v201209 → v201309}/alert_service.rb +7 -7
  82. data/lib/adwords_api/v201309/alert_service_registry.rb +46 -0
  83. data/lib/adwords_api/{v201209/managed_customer_service.rb → v201309/bidding_strategy_service.rb} +9 -9
  84. data/lib/adwords_api/v201309/bidding_strategy_service_registry.rb +46 -0
  85. data/lib/adwords_api/{v201209 → v201309}/budget_order_service.rb +7 -7
  86. data/lib/adwords_api/v201309/budget_order_service_registry.rb +46 -0
  87. data/lib/adwords_api/{v201209 → v201309}/budget_service.rb +7 -7
  88. data/lib/adwords_api/v201309/budget_service_registry.rb +46 -0
  89. data/lib/adwords_api/{v201209 → v201309}/campaign_ad_extension_service.rb +7 -7
  90. data/lib/adwords_api/v201309/campaign_ad_extension_service_registry.rb +46 -0
  91. data/lib/adwords_api/{v201209 → v201309}/campaign_criterion_service.rb +7 -7
  92. data/lib/adwords_api/v201309/campaign_criterion_service_registry.rb +46 -0
  93. data/lib/adwords_api/v201309/campaign_feed_service.rb +38 -0
  94. data/lib/adwords_api/v201309/campaign_feed_service_registry.rb +46 -0
  95. data/lib/adwords_api/{v201209 → v201309}/campaign_service.rb +7 -7
  96. data/lib/adwords_api/v201309/campaign_service_registry.rb +46 -0
  97. data/lib/adwords_api/v201309/campaign_shared_set_service.rb +38 -0
  98. data/lib/adwords_api/v201309/campaign_shared_set_service_registry.rb +47 -0
  99. data/lib/adwords_api/{v201209 → v201309}/constant_data_service.rb +7 -7
  100. data/lib/adwords_api/v201309/constant_data_service_registry.rb +46 -0
  101. data/lib/adwords_api/{v201209 → v201309}/conversion_tracker_service.rb +7 -7
  102. data/lib/adwords_api/v201309/conversion_tracker_service_registry.rb +46 -0
  103. data/lib/adwords_api/{v201209 → v201309}/customer_service.rb +7 -7
  104. data/lib/adwords_api/v201309/customer_service_registry.rb +46 -0
  105. data/lib/adwords_api/{v201209 → v201309}/customer_sync_service.rb +7 -7
  106. data/lib/adwords_api/v201309/customer_sync_service_registry.rb +47 -0
  107. data/lib/adwords_api/{v201209 → v201309}/data_service.rb +7 -7
  108. data/lib/adwords_api/v201309/data_service_registry.rb +46 -0
  109. data/lib/adwords_api/{v201209 → v201309}/experiment_service.rb +7 -7
  110. data/lib/adwords_api/v201309/experiment_service_registry.rb +46 -0
  111. data/lib/adwords_api/{v201209/user_list_service.rb → v201309/feed_item_service.rb} +9 -9
  112. data/lib/adwords_api/v201309/feed_item_service_registry.rb +46 -0
  113. data/lib/adwords_api/v201309/feed_mapping_service.rb +38 -0
  114. data/lib/adwords_api/v201309/feed_mapping_service_registry.rb +46 -0
  115. data/lib/adwords_api/v201309/feed_service.rb +38 -0
  116. data/lib/adwords_api/v201309/feed_service_registry.rb +46 -0
  117. data/lib/adwords_api/{v201209 → v201309}/geo_location_service.rb +7 -7
  118. data/lib/adwords_api/v201309/geo_location_service_registry.rb +46 -0
  119. data/lib/adwords_api/{v201209 → v201309}/location_criterion_service.rb +7 -7
  120. data/lib/adwords_api/v201309/location_criterion_service_registry.rb +46 -0
  121. data/lib/adwords_api/v201309/managed_customer_service.rb +50 -0
  122. data/lib/adwords_api/v201309/managed_customer_service_registry.rb +46 -0
  123. data/lib/adwords_api/{v201209 → v201309}/media_service.rb +7 -7
  124. data/lib/adwords_api/v201309/media_service_registry.rb +46 -0
  125. data/lib/adwords_api/{v201209 → v201309}/mutate_job_service.rb +7 -7
  126. data/lib/adwords_api/v201309/mutate_job_service_registry.rb +46 -0
  127. data/lib/adwords_api/v201309/offline_conversion_feed_service.rb +34 -0
  128. data/lib/adwords_api/v201309/offline_conversion_feed_service_registry.rb +46 -0
  129. data/lib/adwords_api/{v201209 → v201309}/report_definition_service.rb +7 -7
  130. data/lib/adwords_api/v201309/report_definition_service_registry.rb +46 -0
  131. data/lib/adwords_api/v201309/shared_criterion_service.rb +38 -0
  132. data/lib/adwords_api/v201309/shared_criterion_service_registry.rb +47 -0
  133. data/lib/adwords_api/v201309/shared_set_service.rb +38 -0
  134. data/lib/adwords_api/v201309/shared_set_service_registry.rb +47 -0
  135. data/lib/adwords_api/{v201209 → v201309}/targeting_idea_service.rb +7 -7
  136. data/lib/adwords_api/v201309/targeting_idea_service_registry.rb +46 -0
  137. data/lib/adwords_api/{v201209 → v201309}/traffic_estimator_service.rb +7 -7
  138. data/lib/adwords_api/{v201209 → v201309}/traffic_estimator_service_registry.rb +5 -5
  139. data/lib/adwords_api/version.rb +1 -1
  140. data/test/adwords_api/test_adwords_api.rb +1 -1
  141. data/test/adwords_api/test_api_config.rb +8 -8
  142. data/test/adwords_api/test_report_utils.rb +1 -1
  143. data/test/bugs/test_issue_00000031.rb +2 -2
  144. data/test/bugs/test_issue_00000063.rb +6 -6
  145. data/test/templates/v201302/basic_operations_get_campaigns.def +1 -1
  146. data/test/templates/v201302/misc_use_oauth2_jwt.def +1 -1
  147. data/test/templates/v201306/basic_operations_get_campaigns.def +1 -1
  148. data/test/templates/v201306/misc_use_oauth2_jwt.def +1 -1
  149. data/test/templates/{v201209 → v201309}/basic_operations_get_campaigns.def +7 -7
  150. data/test/templates/v201309/misc_use_oauth2_jwt.def +131 -0
  151. metadata +416 -430
  152. data/examples/v201209/account_management/get_client_customer_id.rb +0 -88
  153. data/examples/v201209/account_management/get_client_unit_usage.rb +0 -90
  154. data/examples/v201209/adwords_for_video/add_video_campaign.rb +0 -103
  155. data/examples/v201209/adwords_for_video/find_videos.rb +0 -92
  156. data/examples/v201209/adwords_for_video/get_keyword_criteria.rb +0 -101
  157. data/examples/v201209/adwords_for_video/get_targeting_groups.rb +0 -93
  158. data/examples/v201209/adwords_for_video/get_video_campaign_stats.rb +0 -126
  159. data/examples/v201209/adwords_for_video/get_video_campaigns.rb +0 -94
  160. data/examples/v201209/campaign_management/set_campaign_enhanced.rb +0 -89
  161. data/lib/adwords_api/v201209/ad_extension_override_service.rb +0 -38
  162. data/lib/adwords_api/v201209/ad_extension_override_service_registry.rb +0 -46
  163. data/lib/adwords_api/v201209/ad_group_ad_service_registry.rb +0 -46
  164. data/lib/adwords_api/v201209/ad_group_bid_modifier_service_registry.rb +0 -46
  165. data/lib/adwords_api/v201209/ad_group_criterion_service_registry.rb +0 -46
  166. data/lib/adwords_api/v201209/ad_group_service_registry.rb +0 -46
  167. data/lib/adwords_api/v201209/ad_param_service_registry.rb +0 -46
  168. data/lib/adwords_api/v201209/alert_service_registry.rb +0 -46
  169. data/lib/adwords_api/v201209/budget_order_service_registry.rb +0 -46
  170. data/lib/adwords_api/v201209/budget_service_registry.rb +0 -46
  171. data/lib/adwords_api/v201209/campaign_ad_extension_service_registry.rb +0 -46
  172. data/lib/adwords_api/v201209/campaign_criterion_service_registry.rb +0 -46
  173. data/lib/adwords_api/v201209/campaign_service_registry.rb +0 -46
  174. data/lib/adwords_api/v201209/constant_data_service_registry.rb +0 -46
  175. data/lib/adwords_api/v201209/conversion_tracker_service_registry.rb +0 -46
  176. data/lib/adwords_api/v201209/customer_service_registry.rb +0 -46
  177. data/lib/adwords_api/v201209/customer_sync_service_registry.rb +0 -47
  178. data/lib/adwords_api/v201209/data_service_registry.rb +0 -46
  179. data/lib/adwords_api/v201209/experiment_service_registry.rb +0 -46
  180. data/lib/adwords_api/v201209/geo_location_service_registry.rb +0 -46
  181. data/lib/adwords_api/v201209/info_service.rb +0 -34
  182. data/lib/adwords_api/v201209/info_service_registry.rb +0 -46
  183. data/lib/adwords_api/v201209/location_criterion_service_registry.rb +0 -46
  184. data/lib/adwords_api/v201209/managed_customer_service_registry.rb +0 -46
  185. data/lib/adwords_api/v201209/media_service_registry.rb +0 -46
  186. data/lib/adwords_api/v201209/mutate_job_service_registry.rb +0 -46
  187. data/lib/adwords_api/v201209/report_definition_service_registry.rb +0 -46
  188. data/lib/adwords_api/v201209/targeting_idea_service_registry.rb +0 -46
  189. data/lib/adwords_api/v201209/user_list_service_registry.rb +0 -46
  190. data/lib/adwords_api/v201209/video_ad_service.rb +0 -38
  191. data/lib/adwords_api/v201209/video_ad_service_registry.rb +0 -46
  192. data/lib/adwords_api/v201209/video_campaign_criterion_service.rb +0 -38
  193. data/lib/adwords_api/v201209/video_campaign_criterion_service_registry.rb +0 -47
  194. data/lib/adwords_api/v201209/video_campaign_service.rb +0 -38
  195. data/lib/adwords_api/v201209/video_campaign_service_registry.rb +0 -46
  196. data/lib/adwords_api/v201209/video_service.rb +0 -42
  197. data/lib/adwords_api/v201209/video_service_registry.rb +0 -46
  198. data/lib/adwords_api/v201209/video_targeting_group_criterion_service.rb +0 -38
  199. data/lib/adwords_api/v201209/video_targeting_group_criterion_service_registry.rb +0 -46
  200. data/lib/adwords_api/v201209/video_targeting_group_service.rb +0 -38
  201. data/lib/adwords_api/v201209/video_targeting_group_service_registry.rb +0 -46
  202. data/test/examples/v201209/test_account_management.rb +0 -60
  203. data/test/examples/v201209/test_basic_operations.rb +0 -177
  204. data/test/examples/v201209/test_campaign_management.rb +0 -124
  205. data/test/examples/v201209/test_error_handling.rb +0 -63
  206. data/test/examples/v201209/test_misc.rb +0 -39
  207. data/test/examples/v201209/test_optimization.rb +0 -63
  208. data/test/examples/v201209/test_remarketing.rb +0 -39
  209. data/test/examples/v201209/test_reporting.rb +0 -84
  210. data/test/examples/v201209/test_targeting.rb +0 -60
  211. data/test/examples/v201209/utils.rb +0 -261
  212. data/test/suite_exampletests_v201209.rb +0 -37
  213. data/test/suite_exampletests_v201306.rb +0 -37
@@ -47,7 +47,6 @@ def add_conversion_tracker()
47
47
  (Time.new.to_f * 1000).to_i,
48
48
  :category => 'DEFAULT',
49
49
  :markup_language => 'HTML',
50
- :http_protocol => 'HTTP',
51
50
  :text_format => 'HIDDEN',
52
51
  # Optional fields:
53
52
  :status => 'ENABLED',
@@ -74,11 +73,19 @@ def add_conversion_tracker()
74
73
  end
75
74
 
76
75
  if __FILE__ == $0
77
- API_VERSION = :v201209
76
+ API_VERSION = :v201309
78
77
 
79
78
  begin
80
79
  add_conversion_tracker()
81
80
 
81
+ # Authorization error.
82
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
83
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
84
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
85
+ "to retrieve and store OAuth2 tokens."
86
+ puts "See this wiki page for more details:\n\n " +
87
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
88
+
82
89
  # HTTP errors.
83
90
  rescue AdsCommon::Errors::HttpError => e
84
91
  puts "HTTP Error: %s" % e
@@ -61,13 +61,21 @@ def download_criteria_report(file_name)
61
61
  end
62
62
 
63
63
  if __FILE__ == $0
64
- API_VERSION = :v201209
64
+ API_VERSION = :v201309
65
65
 
66
66
  begin
67
67
  # File name to write report to.
68
68
  file_name = 'INSERT_OUTPUT_FILE_NAME_HERE'
69
69
  download_criteria_report(file_name)
70
70
 
71
+ # Authorization error.
72
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
73
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
74
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
75
+ "to retrieve and store OAuth2 tokens."
76
+ puts "See this wiki page for more details:\n\n " +
77
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
78
+
71
79
  # HTTP errors.
72
80
  rescue AdsCommon::Errors::HttpError => e
73
81
  puts "HTTP Error: %s" % e
@@ -59,7 +59,7 @@ def download_criteria_report_with_awql(file_name, report_format)
59
59
  end
60
60
 
61
61
  if __FILE__ == $0
62
- API_VERSION = :v201209
62
+ API_VERSION = :v201309
63
63
 
64
64
  begin
65
65
  # File name to write report to.
@@ -67,6 +67,14 @@ if __FILE__ == $0
67
67
  report_format = 'CSV'
68
68
  download_criteria_report_with_awql(file_name, report_format)
69
69
 
70
+ # Authorization error.
71
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
72
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
73
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
74
+ "to retrieve and store OAuth2 tokens."
75
+ puts "See this wiki page for more details:\n\n " +
76
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
77
+
70
78
  # HTTP errors.
71
79
  rescue AdsCommon::Errors::HttpError => e
72
80
  puts 'HTTP Error: %s' % e
@@ -81,12 +81,20 @@ def get_campaign_stats()
81
81
  end
82
82
 
83
83
  if __FILE__ == $0
84
- API_VERSION = :v201209
84
+ API_VERSION = :v201309
85
85
  PAGE_SIZE = 500
86
86
 
87
87
  begin
88
88
  get_campaign_stats()
89
89
 
90
+ # Authorization error.
91
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
92
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
93
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
94
+ "to retrieve and store OAuth2 tokens."
95
+ puts "See this wiki page for more details:\n\n " +
96
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
97
+
90
98
  # HTTP errors.
91
99
  rescue AdsCommon::Errors::HttpError => e
92
100
  puts "HTTP Error: %s" % e
@@ -47,12 +47,20 @@ def get_report_fields(report_type)
47
47
  end
48
48
 
49
49
  if __FILE__ == $0
50
- API_VERSION = :v201209
50
+ API_VERSION = :v201309
51
51
 
52
52
  begin
53
53
  report_type = 'INSERT_REPORT_TYPE_HERE'
54
54
  get_report_fields(report_type)
55
55
 
56
+ # Authorization error.
57
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
58
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
59
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
60
+ "to retrieve and store OAuth2 tokens."
61
+ puts "See this wiki page for more details:\n\n " +
62
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
63
+
56
64
  # HTTP errors.
57
65
  rescue AdsCommon::Errors::HttpError => e
58
66
  puts "HTTP Error: %s" % e
@@ -141,7 +141,7 @@ def parallel_report_download()
141
141
  end
142
142
 
143
143
  if __FILE__ == $0
144
- API_VERSION = :v201209
144
+ API_VERSION = :v201309
145
145
  # Number of parallel threads to spawn.
146
146
  THREADS = 10
147
147
  # Maximum number of retries for 500 errors.
@@ -152,6 +152,14 @@ if __FILE__ == $0
152
152
  begin
153
153
  parallel_report_download()
154
154
 
155
+ # Authorization error.
156
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
157
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
158
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
159
+ "to retrieve and store OAuth2 tokens."
160
+ puts "See this wiki page for more details:\n\n " +
161
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
162
+
155
163
  # HTTP errors.
156
164
  rescue AdsCommon::Errors::HttpError => e
157
165
  puts 'HTTP Error: %s' % e
@@ -46,10 +46,7 @@ def add_campaign_targeting_criteria(campaign_id)
46
46
  # Language criteria. The IDs can be found in the documentation or retrieved
47
47
  # with the ConstantDataService.
48
48
  {:xsi_type => 'Language', :id => 1000}, # English
49
- {:xsi_type => 'Language', :id => 1003}, # Spanish
50
- # Platform criteria. The IDs can be found in the documentation.
51
- {:xsi_type => 'Platform', :id => 30001}, # Mobile
52
- {:xsi_type => 'Platform', :id => 30002} # Tablets
49
+ {:xsi_type => 'Language', :id => 1003} # Spanish
53
50
  ]
54
51
 
55
52
  # Create operations.
@@ -94,12 +91,20 @@ def add_campaign_targeting_criteria(campaign_id)
94
91
  end
95
92
 
96
93
  if __FILE__ == $0
97
- API_VERSION = :v201209
94
+ API_VERSION = :v201309
98
95
 
99
96
  begin
100
97
  campaign_id = 'INSERT_CAMPAIGN_ID_HERE'
101
98
  add_campaign_targeting_criteria(campaign_id)
102
99
 
100
+ # Authorization error.
101
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
102
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
103
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
104
+ "to retrieve and store OAuth2 tokens."
105
+ puts "See this wiki page for more details:\n\n " +
106
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
107
+
103
108
  # HTTP errors.
104
109
  rescue AdsCommon::Errors::HttpError => e
105
110
  puts "HTTP Error: %s" % e
@@ -84,12 +84,20 @@ def add_demographic_targeting_criteria(ad_group_id)
84
84
  end
85
85
 
86
86
  if __FILE__ == $0
87
- API_VERSION = :v201209
87
+ API_VERSION = :v201309
88
88
 
89
89
  begin
90
90
  ad_group_id = 'INSERT_AD_GROUP_ID_HERE'
91
91
  add_demographic_targeting_criteria(ad_group_id)
92
92
 
93
+ # Authorization error.
94
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
95
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
96
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
97
+ "to retrieve and store OAuth2 tokens."
98
+ puts "See this wiki page for more details:\n\n " +
99
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
100
+
93
101
  # HTTP errors.
94
102
  rescue AdsCommon::Errors::HttpError => e
95
103
  puts "HTTP Error: %s" % e
@@ -76,7 +76,7 @@ def get_campaign_targeting_criteria(campaign_id)
76
76
  end
77
77
 
78
78
  if __FILE__ == $0
79
- API_VERSION = :v201209
79
+ API_VERSION = :v201309
80
80
  PAGE_SIZE = 500
81
81
 
82
82
  begin
@@ -84,6 +84,14 @@ if __FILE__ == $0
84
84
  campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
85
85
  get_campaign_targeting_criteria(campaign_id)
86
86
 
87
+ # Authorization error.
88
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
89
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
90
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
91
+ "to retrieve and store OAuth2 tokens."
92
+ puts "See this wiki page for more details:\n\n " +
93
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
94
+
87
95
  # HTTP errors.
88
96
  rescue AdsCommon::Errors::HttpError => e
89
97
  puts "HTTP Error: %s" % e
@@ -63,11 +63,19 @@ def get_targetable_languages_and_carriers()
63
63
  end
64
64
 
65
65
  if __FILE__ == $0
66
- API_VERSION = :v201209
66
+ API_VERSION = :v201309
67
67
 
68
68
  begin
69
69
  get_targetable_languages_and_carriers()
70
70
 
71
+ # Authorization error.
72
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
73
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
74
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
75
+ "to retrieve and store OAuth2 tokens."
76
+ puts "See this wiki page for more details:\n\n " +
77
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
78
+
71
79
  # HTTP errors.
72
80
  rescue AdsCommon::Errors::HttpError => e
73
81
  puts "HTTP Error: %s" % e
@@ -81,11 +81,19 @@ def lookup_location()
81
81
  end
82
82
 
83
83
  if __FILE__ == $0
84
- API_VERSION = :v201209
84
+ API_VERSION = :v201309
85
85
 
86
86
  begin
87
87
  lookup_location()
88
88
 
89
+ # Authorization error.
90
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
91
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
92
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
93
+ "to retrieve and store OAuth2 tokens."
94
+ puts "See this wiki page for more details:\n\n " +
95
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
96
+
89
97
  # HTTP errors.
90
98
  rescue AdsCommon::Errors::HttpError => e
91
99
  puts "HTTP Error: %s" % e
@@ -35,9 +35,9 @@ module AdwordsApi
35
35
  end
36
36
 
37
37
  # Set defaults
38
- DEFAULT_VERSION = :v201306
38
+ DEFAULT_VERSION = :v201309
39
39
  DEFAULT_ENVIRONMENT = :PRODUCTION
40
- LATEST_VERSION = :v201306
40
+ LATEST_VERSION = :v201309
41
41
 
42
42
  # Set other constants
43
43
  API_NAME = 'AdwordsApi'
@@ -45,11 +45,12 @@ module AdwordsApi
45
45
 
46
46
  # Configure the services available to each version
47
47
  @@service_config = {
48
- :v201209 => [
48
+ :v201302 => [
49
49
  :AdExtensionOverrideService,
50
50
  :AdGroupAdService,
51
51
  :AdGroupBidModifierService,
52
52
  :AdGroupCriterionService,
53
+ :AdGroupFeedService,
53
54
  :AdGroupService,
54
55
  :AdParamService,
55
56
  :AlertService,
@@ -57,20 +58,26 @@ module AdwordsApi
57
58
  :BudgetService,
58
59
  :CampaignAdExtensionService,
59
60
  :CampaignCriterionService,
61
+ :CampaignFeedService,
60
62
  :CampaignService,
63
+ :CampaignSharedSetService,
61
64
  :ConstantDataService,
62
65
  :ConversionTrackerService,
63
66
  :CustomerService,
64
67
  :CustomerSyncService,
65
68
  :DataService,
66
69
  :ExperimentService,
70
+ :FeedItemService,
71
+ :FeedMappingService,
72
+ :FeedService,
67
73
  :GeoLocationService,
68
- :InfoService,
69
74
  :LocationCriterionService,
70
75
  :ManagedCustomerService,
71
76
  :MediaService,
72
77
  :MutateJobService,
73
78
  :ReportDefinitionService,
79
+ :SharedCriterionService,
80
+ :SharedSetService,
74
81
  :TargetingIdeaService,
75
82
  :TrafficEstimatorService,
76
83
  :UserListService,
@@ -82,7 +89,7 @@ module AdwordsApi
82
89
  :VideoTargetingGroupCriterionService,
83
90
  :VideoTargetingGroupService
84
91
  ],
85
- :v201302 => [
92
+ :v201306 => [
86
93
  :AdExtensionOverrideService,
87
94
  :AdGroupAdService,
88
95
  :AdGroupBidModifierService,
@@ -90,7 +97,9 @@ module AdwordsApi
90
97
  :AdGroupFeedService,
91
98
  :AdGroupService,
92
99
  :AdParamService,
100
+ :AdwordsUserListService,
93
101
  :AlertService,
102
+ :BiddingStrategyService,
94
103
  :BudgetOrderService,
95
104
  :BudgetService,
96
105
  :CampaignAdExtensionService,
@@ -116,18 +125,9 @@ module AdwordsApi
116
125
  :SharedCriterionService,
117
126
  :SharedSetService,
118
127
  :TargetingIdeaService,
119
- :TrafficEstimatorService,
120
- :UserListService,
121
- # AdWords for Video API Beta services.
122
- :VideoAdService,
123
- :VideoCampaignCriterionService,
124
- :VideoCampaignService,
125
- :VideoService,
126
- :VideoTargetingGroupCriterionService,
127
- :VideoTargetingGroupService
128
+ :TrafficEstimatorService
128
129
  ],
129
- :v201306 => [
130
- :AdExtensionOverrideService,
130
+ :v201309 => [
131
131
  :AdGroupAdService,
132
132
  :AdGroupBidModifierService,
133
133
  :AdGroupCriterionService,
@@ -158,6 +158,7 @@ module AdwordsApi
158
158
  :ManagedCustomerService,
159
159
  :MediaService,
160
160
  :MutateJobService,
161
+ :OfflineConversionFeedService,
161
162
  :ReportDefinitionService,
162
163
  :SharedCriterionService,
163
164
  :SharedSetService,
@@ -171,51 +172,15 @@ module AdwordsApi
171
172
  :PRODUCTION => {
172
173
  :oauth_scope => 'https://adwords.google.com/api/adwords/',
173
174
  :header_ns => 'https://adwords.google.com/api/adwords/cm/',
174
- :v201209 => 'https://adwords.google.com/api/adwords/',
175
175
  :v201302 => 'https://adwords.google.com/api/adwords/',
176
- :v201306 => 'https://adwords.google.com/api/adwords/'
176
+ :v201306 => 'https://adwords.google.com/api/adwords/',
177
+ :v201309 => 'https://adwords.google.com/api/adwords/'
177
178
  }
178
179
  }
179
180
 
180
181
  # Configure the subdirectories for each version / service pair.
181
182
  # A missing pair means that only the base URL is used.
182
183
  @@subdir_config = {
183
- # v201209
184
- [:v201209, :AdExtensionOverrideService] => 'cm/',
185
- [:v201209, :AdGroupAdService] => 'cm/',
186
- [:v201209, :AdGroupBidModifierService] => 'cm/',
187
- [:v201209, :AdGroupCriterionService] => 'cm/',
188
- [:v201209, :AdGroupService] => 'cm/',
189
- [:v201209, :AdParamService] => 'cm/',
190
- [:v201209, :AlertService] => 'mcm/',
191
- [:v201209, :BudgetOrderService] => 'billing/',
192
- [:v201209, :CampaignAdExtensionService] => 'cm/',
193
- [:v201209, :CampaignCriterionService] => 'cm/',
194
- [:v201209, :CampaignService] => 'cm/',
195
- [:v201209, :ConstantDataService] => 'cm/',
196
- [:v201209, :ConversionTrackerService] => 'cm/',
197
- [:v201209, :CustomerSyncService] => 'ch/',
198
- [:v201209, :DataService] => 'cm/',
199
- [:v201209, :ExperimentService] => 'cm/',
200
- [:v201209, :GeoLocationService] => 'cm/',
201
- [:v201209, :InfoService] => 'info/',
202
- [:v201209, :LocationCriterionService] => 'cm/',
203
- [:v201209, :MediaService] => 'cm/',
204
- [:v201209, :MutateJobService] => 'cm/',
205
- [:v201209, :ReportDefinitionService] => 'cm/',
206
- [:v201209, :TargetingIdeaService] => 'o/',
207
- [:v201209, :TrafficEstimatorService] => 'o/',
208
- [:v201209, :UserListService] => 'cm/',
209
- [:v201209, :ManagedCustomerService] => 'mcm/',
210
- [:v201209, :CustomerService] => 'mcm/',
211
- [:v201209, :BudgetService] => 'cm/',
212
- # AdWords for Video API Beta services.
213
- [:v201209, :VideoAdService] => 'video/',
214
- [:v201209, :VideoCampaignCriterionService] => 'video/',
215
- [:v201209, :VideoCampaignService] => 'video/',
216
- [:v201209, :VideoService] => 'video/',
217
- [:v201209, :VideoTargetingGroupCriterionService] => 'video/',
218
- [:v201209, :VideoTargetingGroupService] => 'video/',
219
184
  # v201302
220
185
  [:v201302, :AdExtensionOverrideService] => 'cm/',
221
186
  [:v201302, :AdGroupAdService] => 'cm/',
@@ -295,7 +260,44 @@ module AdwordsApi
295
260
  [:v201306, :CustomerService] => 'mcm/',
296
261
  [:v201306, :BudgetService] => 'cm/',
297
262
  [:v201306, :BiddingStrategyService] => 'cm/',
298
- [:v201306, :AdwordsUserListService] => 'rm/'
263
+ [:v201306, :AdwordsUserListService] => 'rm/',
264
+ # v201309
265
+ [:v201309, :AdGroupAdService] => 'cm/',
266
+ [:v201309, :AdGroupBidModifierService] => 'cm/',
267
+ [:v201309, :AdGroupCriterionService] => 'cm/',
268
+ [:v201309, :AdGroupFeedService] => 'cm/',
269
+ [:v201309, :AdGroupService] => 'cm/',
270
+ [:v201309, :AdParamService] => 'cm/',
271
+ [:v201309, :AlertService] => 'mcm/',
272
+ [:v201309, :BudgetOrderService] => 'billing/',
273
+ [:v201309, :CampaignAdExtensionService] => 'cm/',
274
+ [:v201309, :CampaignCriterionService] => 'cm/',
275
+ [:v201309, :CampaignFeedService] => 'cm/',
276
+ [:v201309, :CampaignService] => 'cm/',
277
+ [:v201309, :CampaignSharedSetService] => 'cm/',
278
+ [:v201309, :ConstantDataService] => 'cm/',
279
+ [:v201309, :ConversionTrackerService] => 'cm/',
280
+ [:v201309, :CustomerSyncService] => 'ch/',
281
+ [:v201309, :DataService] => 'cm/',
282
+ [:v201309, :ExperimentService] => 'cm/',
283
+ [:v201309, :FeedItemService] => 'cm/',
284
+ [:v201309, :FeedMappingService] => 'cm/',
285
+ [:v201309, :FeedService] => 'cm/',
286
+ [:v201309, :GeoLocationService] => 'cm/',
287
+ [:v201309, :LocationCriterionService] => 'cm/',
288
+ [:v201309, :MediaService] => 'cm/',
289
+ [:v201309, :MutateJobService] => 'cm/',
290
+ [:v201309, :OfflineConversionFeedService] => 'cm/',
291
+ [:v201309, :ReportDefinitionService] => 'cm/',
292
+ [:v201309, :SharedCriterionService] => 'cm/',
293
+ [:v201309, :SharedSetService] => 'cm/',
294
+ [:v201309, :TargetingIdeaService] => 'o/',
295
+ [:v201309, :TrafficEstimatorService] => 'o/',
296
+ [:v201309, :ManagedCustomerService] => 'mcm/',
297
+ [:v201309, :CustomerService] => 'mcm/',
298
+ [:v201309, :BudgetService] => 'cm/',
299
+ [:v201309, :BiddingStrategyService] => 'cm/',
300
+ [:v201309, :AdwordsUserListService] => 'rm/'
299
301
  }
300
302
 
301
303
  # Auth constants for ClientLogin method.