google-adwords-api 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. data/ChangeLog +9 -0
  2. data/README +26 -10
  3. data/Rakefile +1 -1
  4. data/examples/v200909/add_ad_group.rb +2 -2
  5. data/examples/v200909/add_ads.rb +4 -4
  6. data/examples/v200909/add_campaign.rb +2 -2
  7. data/examples/v200909/check_campaigns.rb +4 -4
  8. data/examples/v201003/add_ad_group.rb +2 -2
  9. data/examples/v201003/add_ads.rb +6 -6
  10. data/examples/v201003/add_campaign.rb +2 -2
  11. data/examples/v201003/add_keywords_performance_report_definition.rb +2 -2
  12. data/examples/v201003/check_campaigns.rb +4 -4
  13. data/examples/v201008/add_ad_group.rb +2 -2
  14. data/examples/v201008/add_ads.rb +7 -7
  15. data/examples/v201008/add_campaign.rb +2 -2
  16. data/examples/v201008/add_experiment.rb +5 -5
  17. data/examples/v201008/add_keywords_performance_report_definition.rb +2 -2
  18. data/examples/v201008/add_user_list.rb +2 -2
  19. data/examples/v201008/check_campaigns.rb +4 -4
  20. data/examples/v201008/get_account_hierarchy.rb +8 -11
  21. data/examples/v201101/add_ad_group.rb +2 -2
  22. data/examples/v201101/add_ads.rb +6 -6
  23. data/examples/v201101/add_campaign.rb +2 -2
  24. data/examples/v201101/add_conversion.rb +4 -4
  25. data/examples/v201101/add_experiment.rb +5 -5
  26. data/examples/v201101/add_keywords_performance_report_definition.rb +2 -2
  27. data/examples/v201101/add_user_list.rb +3 -3
  28. data/examples/v201101/check_campaigns.rb +4 -4
  29. data/examples/v201101/get_account_hierarchy.rb +7 -9
  30. data/examples/v201109/add_ad_extension_override.rb +82 -0
  31. data/examples/v201109/add_ad_group.rb +89 -0
  32. data/examples/v201109/add_ad_group_criteria.rb +109 -0
  33. data/examples/v201109/add_ads.rb +174 -0
  34. data/examples/v201109/add_campaign.rb +99 -0
  35. data/examples/v201109/add_campaign_ad_extension.rb +121 -0
  36. data/examples/v201109/add_campaign_targeting_criteria.rb +102 -0
  37. data/examples/{v201101/add_mcc_report_definition.rb → v201109/add_conversion.rb} +26 -28
  38. data/examples/v201109/add_experiment.rb +153 -0
  39. data/examples/v201109/add_negative_campaign_criterion.rb +87 -0
  40. data/examples/v201109/add_user_list.rb +113 -0
  41. data/examples/v201109/check_campaigns.rb +123 -0
  42. data/examples/v201109/delete_ad.rb +85 -0
  43. data/examples/v201109/delete_ad_group.rb +77 -0
  44. data/examples/v201109/delete_ad_group_criterion.rb +86 -0
  45. data/examples/v201109/delete_bulk_mutate_job.rb +87 -0
  46. data/examples/v201109/delete_campaign.rb +78 -0
  47. data/examples/v201109/delete_experiment.rb +78 -0
  48. data/examples/v201109/delete_user_list.rb +78 -0
  49. data/examples/v201109/download_adhoc_report.rb +79 -0
  50. data/examples/v201109/download_report.rb +67 -0
  51. data/examples/v201109/get_account_hierarchy.rb +93 -0
  52. data/examples/v201109/get_ad_group_bid_landscape.rb +94 -0
  53. data/examples/v201109/get_all_account_changes.rb +137 -0
  54. data/examples/v201109/get_all_active_ad_group_criteria.rb +98 -0
  55. data/examples/v201109/get_all_ad_extension_overrides.rb +82 -0
  56. data/examples/v201109/get_all_ad_group_criteria.rb +90 -0
  57. data/examples/v201109/get_all_ad_groups.rb +85 -0
  58. data/examples/v201109/get_all_ad_params.rb +86 -0
  59. data/examples/v201109/get_all_ads.rb +90 -0
  60. data/examples/v201109/get_all_campaign_ad_extensions.rb +87 -0
  61. data/examples/v201109/get_all_campaign_targets.rb +74 -0
  62. data/examples/v201109/get_all_campaigns.rb +77 -0
  63. data/examples/v201109/get_all_carriers.rb +72 -0
  64. data/examples/v201109/get_all_conversions.rb +79 -0
  65. data/examples/v201109/get_all_disapproved_ads.rb +93 -0
  66. data/examples/v201109/get_all_experiments.rb +89 -0
  67. data/examples/v201109/get_all_images.rb +82 -0
  68. data/examples/v201109/get_all_languages.rb +73 -0
  69. data/examples/v201109/get_all_paused_campaigns.rb +83 -0
  70. data/examples/v201109/get_all_report_definitions.rb +75 -0
  71. data/examples/v201109/get_all_user_lists.rb +78 -0
  72. data/examples/v201109/get_all_videos.rb +78 -0
  73. data/examples/v201109/get_bulk_mutate_job.rb +97 -0
  74. data/examples/v201109/get_campaign_alerts.rb +95 -0
  75. data/examples/v201109/get_client_customer_id.rb +87 -0
  76. data/examples/v201109/get_conversion_optimizer_eligibility.rb +93 -0
  77. data/examples/v201109/get_criterion_bid_landscape.rb +93 -0
  78. data/examples/v201109/get_geo_location_info.rb +99 -0
  79. data/examples/v201109/get_keyword_opportunities.rb +95 -0
  80. data/examples/v201109/get_location_criteria.rb +103 -0
  81. data/examples/v201109/get_method_cost.rb +87 -0
  82. data/examples/v201109/get_operation_count.rb +79 -0
  83. data/examples/v201109/get_related_keywords.rb +108 -0
  84. data/examples/v201109/get_related_placements.rb +107 -0
  85. data/examples/v201109/get_report_fields.rb +72 -0
  86. data/examples/v201109/get_total_usage_units_per_month.rb +74 -0
  87. data/examples/v201109/get_traffic_estimates.rb +129 -0
  88. data/examples/v201109/get_unit_count.rb +81 -0
  89. data/examples/v201109/handle_partial_failures.rb +127 -0
  90. data/examples/v201109/handle_policy_violation_error.rb +138 -0
  91. data/examples/v201109/handle_second_factor.rb +87 -0
  92. data/examples/v201109/oauth_handling.rb +95 -0
  93. data/examples/v201109/perform_bulk_mutate_job.rb +212 -0
  94. data/examples/v201109/perform_mutate_job.rb +177 -0
  95. data/examples/v201109/promote_experiment.rb +79 -0
  96. data/examples/v201109/set_ad_params.rb +115 -0
  97. data/examples/v201109/update_ad.rb +86 -0
  98. data/examples/v201109/update_ad_group.rb +81 -0
  99. data/examples/v201109/update_ad_group_criterion.rb +99 -0
  100. data/examples/v201109/update_campaign.rb +84 -0
  101. data/examples/v201109/update_conversion.rb +87 -0
  102. data/examples/v201109/update_user_list.rb +82 -0
  103. data/examples/v201109/upload_image.rb +90 -0
  104. data/lib/adwords_api.rb +54 -50
  105. data/lib/adwords_api/api_config.rb +70 -14
  106. data/lib/adwords_api/credential_handler.rb +32 -13
  107. data/lib/adwords_api/errors.rb +12 -0
  108. data/lib/adwords_api/extensions.rb +8 -118
  109. data/lib/adwords_api/report_utils.rb +198 -0
  110. data/lib/adwords_api/utils.rb +5 -2
  111. data/lib/adwords_api/v13/account_service.rb +11 -11
  112. data/lib/adwords_api/v13/account_service_registry.rb +5 -3
  113. data/lib/adwords_api/v13/report_service.rb +15 -15
  114. data/lib/adwords_api/v13/report_service_registry.rb +5 -3
  115. data/lib/adwords_api/v200909/ad_extension_override_service.rb +5 -5
  116. data/lib/adwords_api/v200909/ad_extension_override_service_registry.rb +5 -3
  117. data/lib/adwords_api/v200909/ad_group_ad_service.rb +5 -5
  118. data/lib/adwords_api/v200909/ad_group_ad_service_registry.rb +5 -3
  119. data/lib/adwords_api/v200909/ad_group_criterion_service.rb +5 -5
  120. data/lib/adwords_api/v200909/ad_group_criterion_service_registry.rb +5 -3
  121. data/lib/adwords_api/v200909/ad_group_service.rb +5 -5
  122. data/lib/adwords_api/v200909/ad_group_service_registry.rb +5 -3
  123. data/lib/adwords_api/v200909/ad_param_service.rb +5 -5
  124. data/lib/adwords_api/v200909/ad_param_service_registry.rb +5 -3
  125. data/lib/adwords_api/v200909/bulk_mutate_job_service.rb +5 -5
  126. data/lib/adwords_api/v200909/bulk_mutate_job_service_registry.rb +5 -3
  127. data/lib/adwords_api/v200909/campaign_ad_extension_service.rb +5 -5
  128. data/lib/adwords_api/v200909/campaign_ad_extension_service_registry.rb +5 -3
  129. data/lib/adwords_api/v200909/campaign_criterion_service.rb +5 -5
  130. data/lib/adwords_api/v200909/campaign_criterion_service_registry.rb +5 -3
  131. data/lib/adwords_api/v200909/campaign_service.rb +5 -5
  132. data/lib/adwords_api/v200909/campaign_service_registry.rb +5 -3
  133. data/lib/adwords_api/v200909/campaign_target_service.rb +5 -5
  134. data/lib/adwords_api/v200909/campaign_target_service_registry.rb +5 -3
  135. data/lib/adwords_api/v200909/geo_location_service.rb +3 -3
  136. data/lib/adwords_api/v200909/geo_location_service_registry.rb +5 -3
  137. data/lib/adwords_api/v200909/info_service.rb +3 -3
  138. data/lib/adwords_api/v200909/info_service_registry.rb +5 -3
  139. data/lib/adwords_api/v200909/targeting_idea_service.rb +5 -5
  140. data/lib/adwords_api/v200909/targeting_idea_service_registry.rb +5 -3
  141. data/lib/adwords_api/v201003/ad_extension_override_service.rb +5 -5
  142. data/lib/adwords_api/v201003/ad_extension_override_service_registry.rb +5 -3
  143. data/lib/adwords_api/v201003/ad_group_ad_service.rb +5 -5
  144. data/lib/adwords_api/v201003/ad_group_ad_service_registry.rb +5 -3
  145. data/lib/adwords_api/v201003/ad_group_criterion_service.rb +5 -5
  146. data/lib/adwords_api/v201003/ad_group_criterion_service_registry.rb +5 -3
  147. data/lib/adwords_api/v201003/ad_group_service.rb +5 -5
  148. data/lib/adwords_api/v201003/ad_group_service_registry.rb +5 -3
  149. data/lib/adwords_api/v201003/ad_param_service.rb +5 -5
  150. data/lib/adwords_api/v201003/ad_param_service_registry.rb +5 -3
  151. data/lib/adwords_api/v201003/bid_landscape_service.rb +3 -3
  152. data/lib/adwords_api/v201003/bid_landscape_service_registry.rb +5 -3
  153. data/lib/adwords_api/v201003/bulk_mutate_job_service.rb +5 -5
  154. data/lib/adwords_api/v201003/bulk_mutate_job_service_registry.rb +5 -3
  155. data/lib/adwords_api/v201003/campaign_ad_extension_service.rb +5 -5
  156. data/lib/adwords_api/v201003/campaign_ad_extension_service_registry.rb +5 -3
  157. data/lib/adwords_api/v201003/campaign_criterion_service.rb +5 -5
  158. data/lib/adwords_api/v201003/campaign_criterion_service_registry.rb +5 -3
  159. data/lib/adwords_api/v201003/campaign_service.rb +5 -5
  160. data/lib/adwords_api/v201003/campaign_service_registry.rb +5 -3
  161. data/lib/adwords_api/v201003/campaign_target_service.rb +5 -5
  162. data/lib/adwords_api/v201003/campaign_target_service_registry.rb +5 -3
  163. data/lib/adwords_api/v201003/geo_location_service.rb +3 -3
  164. data/lib/adwords_api/v201003/geo_location_service_registry.rb +5 -3
  165. data/lib/adwords_api/v201003/info_service.rb +3 -3
  166. data/lib/adwords_api/v201003/info_service_registry.rb +5 -3
  167. data/lib/adwords_api/v201003/media_service.rb +5 -5
  168. data/lib/adwords_api/v201003/media_service_registry.rb +5 -3
  169. data/lib/adwords_api/v201003/report_definition_service.rb +7 -7
  170. data/lib/adwords_api/v201003/report_definition_service_registry.rb +5 -3
  171. data/lib/adwords_api/v201003/targeting_idea_service.rb +5 -5
  172. data/lib/adwords_api/v201003/targeting_idea_service_registry.rb +5 -3
  173. data/lib/adwords_api/v201008/ad_extension_override_service.rb +5 -5
  174. data/lib/adwords_api/v201008/ad_extension_override_service_registry.rb +5 -3
  175. data/lib/adwords_api/v201008/ad_group_ad_service.rb +5 -5
  176. data/lib/adwords_api/v201008/ad_group_ad_service_registry.rb +5 -3
  177. data/lib/adwords_api/v201008/ad_group_criterion_service.rb +5 -5
  178. data/lib/adwords_api/v201008/ad_group_criterion_service_registry.rb +5 -3
  179. data/lib/adwords_api/v201008/ad_group_service.rb +5 -5
  180. data/lib/adwords_api/v201008/ad_group_service_registry.rb +5 -3
  181. data/lib/adwords_api/v201008/ad_param_service.rb +5 -5
  182. data/lib/adwords_api/v201008/ad_param_service_registry.rb +5 -3
  183. data/lib/adwords_api/v201008/alert_service.rb +3 -3
  184. data/lib/adwords_api/v201008/alert_service_registry.rb +5 -3
  185. data/lib/adwords_api/v201008/bid_landscape_service.rb +3 -3
  186. data/lib/adwords_api/v201008/bid_landscape_service_registry.rb +5 -3
  187. data/lib/adwords_api/v201008/bulk_mutate_job_service.rb +5 -5
  188. data/lib/adwords_api/v201008/bulk_mutate_job_service_registry.rb +5 -3
  189. data/lib/adwords_api/v201008/campaign_ad_extension_service.rb +5 -5
  190. data/lib/adwords_api/v201008/campaign_ad_extension_service_registry.rb +5 -3
  191. data/lib/adwords_api/v201008/campaign_criterion_service.rb +5 -5
  192. data/lib/adwords_api/v201008/campaign_criterion_service_registry.rb +5 -3
  193. data/lib/adwords_api/v201008/campaign_service.rb +5 -5
  194. data/lib/adwords_api/v201008/campaign_service_registry.rb +5 -3
  195. data/lib/adwords_api/v201008/campaign_target_service.rb +5 -5
  196. data/lib/adwords_api/v201008/campaign_target_service_registry.rb +5 -3
  197. data/lib/adwords_api/v201008/customer_sync_service.rb +3 -3
  198. data/lib/adwords_api/v201008/customer_sync_service_registry.rb +5 -3
  199. data/lib/adwords_api/v201008/experiment_service.rb +5 -5
  200. data/lib/adwords_api/v201008/experiment_service_registry.rb +5 -3
  201. data/lib/adwords_api/v201008/geo_location_service.rb +3 -3
  202. data/lib/adwords_api/v201008/geo_location_service_registry.rb +5 -3
  203. data/lib/adwords_api/v201008/info_service.rb +3 -3
  204. data/lib/adwords_api/v201008/info_service_registry.rb +5 -3
  205. data/lib/adwords_api/v201008/media_service.rb +5 -5
  206. data/lib/adwords_api/v201008/media_service_registry.rb +5 -3
  207. data/lib/adwords_api/v201008/report_definition_service.rb +7 -7
  208. data/lib/adwords_api/v201008/report_definition_service_registry.rb +5 -3
  209. data/lib/adwords_api/v201008/serviced_account_service.rb +3 -3
  210. data/lib/adwords_api/v201008/serviced_account_service_registry.rb +5 -3
  211. data/lib/adwords_api/v201008/targeting_idea_service.rb +5 -5
  212. data/lib/adwords_api/v201008/targeting_idea_service_registry.rb +5 -3
  213. data/lib/adwords_api/v201008/traffic_estimator_service.rb +3 -3
  214. data/lib/adwords_api/v201008/traffic_estimator_service_registry.rb +5 -3
  215. data/lib/adwords_api/v201008/user_list_service.rb +5 -5
  216. data/lib/adwords_api/v201008/user_list_service_registry.rb +5 -3
  217. data/lib/adwords_api/v201101/ad_extension_override_service.rb +5 -5
  218. data/lib/adwords_api/v201101/ad_extension_override_service_registry.rb +5 -3
  219. data/lib/adwords_api/v201101/ad_group_ad_service.rb +5 -5
  220. data/lib/adwords_api/v201101/ad_group_ad_service_registry.rb +5 -3
  221. data/lib/adwords_api/v201101/ad_group_criterion_service.rb +5 -5
  222. data/lib/adwords_api/v201101/ad_group_criterion_service_registry.rb +5 -3
  223. data/lib/adwords_api/v201101/ad_group_service.rb +5 -5
  224. data/lib/adwords_api/v201101/ad_group_service_registry.rb +5 -3
  225. data/lib/adwords_api/v201101/ad_param_service.rb +5 -5
  226. data/lib/adwords_api/v201101/ad_param_service_registry.rb +5 -3
  227. data/lib/adwords_api/v201101/alert_service.rb +3 -3
  228. data/lib/adwords_api/v201101/alert_service_registry.rb +5 -3
  229. data/lib/adwords_api/v201101/bulk_mutate_job_service.rb +5 -5
  230. data/lib/adwords_api/v201101/bulk_mutate_job_service_registry.rb +5 -3
  231. data/lib/adwords_api/v201101/bulk_opportunity_service.rb +3 -3
  232. data/lib/adwords_api/v201101/bulk_opportunity_service_registry.rb +5 -3
  233. data/lib/adwords_api/v201101/campaign_ad_extension_service.rb +5 -5
  234. data/lib/adwords_api/v201101/campaign_ad_extension_service_registry.rb +5 -3
  235. data/lib/adwords_api/v201101/campaign_criterion_service.rb +5 -5
  236. data/lib/adwords_api/v201101/campaign_criterion_service_registry.rb +5 -3
  237. data/lib/adwords_api/v201101/campaign_service.rb +5 -5
  238. data/lib/adwords_api/v201101/campaign_service_registry.rb +5 -3
  239. data/lib/adwords_api/v201101/campaign_target_service.rb +5 -5
  240. data/lib/adwords_api/v201101/campaign_target_service_registry.rb +5 -3
  241. data/lib/adwords_api/v201101/conversion_tracker_service.rb +5 -5
  242. data/lib/adwords_api/v201101/conversion_tracker_service_registry.rb +5 -3
  243. data/lib/adwords_api/v201101/customer_sync_service.rb +3 -3
  244. data/lib/adwords_api/v201101/customer_sync_service_registry.rb +5 -3
  245. data/lib/adwords_api/v201101/data_service.rb +5 -5
  246. data/lib/adwords_api/v201101/data_service_registry.rb +5 -3
  247. data/lib/adwords_api/v201101/experiment_service.rb +5 -5
  248. data/lib/adwords_api/v201101/experiment_service_registry.rb +5 -3
  249. data/lib/adwords_api/v201101/geo_location_service.rb +3 -3
  250. data/lib/adwords_api/v201101/geo_location_service_registry.rb +5 -3
  251. data/lib/adwords_api/v201101/info_service.rb +3 -3
  252. data/lib/adwords_api/v201101/info_service_registry.rb +5 -3
  253. data/lib/adwords_api/v201101/media_service.rb +5 -5
  254. data/lib/adwords_api/v201101/media_service_registry.rb +5 -3
  255. data/lib/adwords_api/v201101/report_definition_service.rb +7 -15
  256. data/lib/adwords_api/v201101/report_definition_service_registry.rb +5 -3
  257. data/lib/adwords_api/v201101/serviced_account_service.rb +3 -3
  258. data/lib/adwords_api/v201101/serviced_account_service_registry.rb +5 -3
  259. data/lib/adwords_api/v201101/targeting_idea_service.rb +5 -5
  260. data/lib/adwords_api/v201101/targeting_idea_service_registry.rb +5 -3
  261. data/lib/adwords_api/v201101/traffic_estimator_service.rb +3 -3
  262. data/lib/adwords_api/v201101/traffic_estimator_service_registry.rb +5 -3
  263. data/lib/adwords_api/v201101/user_list_service.rb +5 -5
  264. data/lib/adwords_api/v201101/user_list_service_registry.rb +5 -3
  265. data/lib/adwords_api/v201109/ad_extension_override_service.rb +36 -0
  266. data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +44 -0
  267. data/lib/adwords_api/v201109/ad_group_ad_service.rb +36 -0
  268. data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +44 -0
  269. data/lib/adwords_api/v201109/ad_group_criterion_service.rb +36 -0
  270. data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +44 -0
  271. data/lib/adwords_api/v201109/ad_group_service.rb +36 -0
  272. data/lib/adwords_api/v201109/ad_group_service_registry.rb +44 -0
  273. data/lib/adwords_api/v201109/ad_param_service.rb +36 -0
  274. data/lib/adwords_api/v201109/ad_param_service_registry.rb +44 -0
  275. data/lib/adwords_api/v201109/alert_service.rb +32 -0
  276. data/lib/adwords_api/v201109/alert_service_registry.rb +44 -0
  277. data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +36 -0
  278. data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +44 -0
  279. data/lib/adwords_api/v201109/bulk_opportunity_service.rb +32 -0
  280. data/lib/adwords_api/v201109/bulk_opportunity_service_registry.rb +44 -0
  281. data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +36 -0
  282. data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +44 -0
  283. data/lib/adwords_api/v201109/campaign_criterion_service.rb +36 -0
  284. data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +44 -0
  285. data/lib/adwords_api/v201109/campaign_service.rb +36 -0
  286. data/lib/adwords_api/v201109/campaign_service_registry.rb +44 -0
  287. data/lib/adwords_api/v201109/campaign_target_service.rb +36 -0
  288. data/lib/adwords_api/v201109/campaign_target_service_registry.rb +44 -0
  289. data/lib/adwords_api/v201109/constant_data_service.rb +36 -0
  290. data/lib/adwords_api/v201109/constant_data_service_registry.rb +44 -0
  291. data/lib/adwords_api/v201109/conversion_tracker_service.rb +36 -0
  292. data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +44 -0
  293. data/lib/adwords_api/v201109/customer_sync_service.rb +32 -0
  294. data/lib/adwords_api/v201109/customer_sync_service_registry.rb +45 -0
  295. data/lib/adwords_api/v201109/data_service.rb +36 -0
  296. data/lib/adwords_api/v201109/data_service_registry.rb +44 -0
  297. data/lib/adwords_api/v201109/experiment_service.rb +36 -0
  298. data/lib/adwords_api/v201109/experiment_service_registry.rb +44 -0
  299. data/lib/adwords_api/v201109/geo_location_service.rb +32 -0
  300. data/lib/adwords_api/v201109/geo_location_service_registry.rb +44 -0
  301. data/lib/adwords_api/v201109/info_service.rb +32 -0
  302. data/lib/adwords_api/v201109/info_service_registry.rb +44 -0
  303. data/lib/adwords_api/v201109/location_criterion_service.rb +32 -0
  304. data/lib/adwords_api/v201109/location_criterion_service_registry.rb +44 -0
  305. data/lib/adwords_api/v201109/media_service.rb +36 -0
  306. data/lib/adwords_api/v201109/media_service_registry.rb +44 -0
  307. data/lib/adwords_api/v201109/mutate_job_service.rb +40 -0
  308. data/lib/adwords_api/v201109/mutate_job_service_registry.rb +44 -0
  309. data/lib/adwords_api/v201109/report_definition_service.rb +45 -0
  310. data/lib/adwords_api/v201109/report_definition_service_registry.rb +44 -0
  311. data/lib/adwords_api/v201109/serviced_account_service.rb +32 -0
  312. data/lib/adwords_api/v201109/serviced_account_service_registry.rb +44 -0
  313. data/lib/adwords_api/v201109/targeting_idea_service.rb +36 -0
  314. data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +44 -0
  315. data/lib/adwords_api/v201109/traffic_estimator_service.rb +32 -0
  316. data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +44 -0
  317. data/lib/adwords_api/v201109/user_list_service.rb +36 -0
  318. data/lib/adwords_api/v201109/user_list_service_registry.rb +44 -0
  319. data/test/bugs/test_issue_00000031.rb +78 -0
  320. metadata +467 -342
  321. data/examples/v201101/download_mcc_report.rb +0 -113
  322. data/examples/v201101/download_mcc_report_as_file.rb +0 -114
  323. data/lib/adwords_api/v13/traffic_estimator_service.rb +0 -44
  324. data/lib/adwords_api/v13/traffic_estimator_service_registry.rb +0 -39
@@ -38,7 +38,7 @@ def add_user_list()
38
38
  user_list_srv = adwords.service(:UserListService, API_VERSION)
39
39
 
40
40
  # Prepare for adding remarketing user list.
41
- name = 'Mars cruise customers #%s' % (Time.new.to_f * 1000).to_i
41
+ name = "Mars cruise customers #%d" % (Time.new.to_f * 1000).to_i
42
42
  operation = {
43
43
  :operator => 'ADD',
44
44
  :operand => {
@@ -58,7 +58,7 @@ def add_user_list()
58
58
  response = user_list_srv.mutate([operation])
59
59
  if response and response[:value]
60
60
  user_list = response[:value].first
61
- puts 'User list with name "%s" and id %d was added.' %
61
+ puts "User list with name '%s' and ID %d was added." %
62
62
  [user_list[:name], user_list[:id]]
63
63
  else
64
64
  puts 'No user lists were added.'
@@ -45,7 +45,7 @@ def check_campaigns()
45
45
  operation = {
46
46
  :operator => 'ADD',
47
47
  :operand => {
48
- :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,
48
+ :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i,
49
49
  :status => 'PAUSED',
50
50
  :bidding_strategy => {
51
51
  # The 'xsi_type' field allows you to specify the xsi:type of the object
@@ -68,8 +68,8 @@ def check_campaigns()
68
68
  if response and response[:value]
69
69
  campaigns = response[:value]
70
70
  campaigns.each do |campaign|
71
- puts "Unexpected campaign creation! Name \"#{campaign[:name]}\", id " +
72
- "#{campaign[:id]} and status is \"#{campaign[:status]}\"."
71
+ puts "Unexpected campaign creation! Name '#{campaign[:name]}', ID " +
72
+ "#{campaign[:id]} and status is '#{campaign[:status]}'."
73
73
  end
74
74
  else
75
75
  puts 'No campaigns created.'
@@ -80,7 +80,7 @@ def check_campaigns()
80
80
  operation = {
81
81
  :operator => 'ADD',
82
82
  :operand => {
83
- :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,
83
+ :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i,
84
84
  :status => 'PAUSED',
85
85
  :bidding_strategy => nil,
86
86
  :budget => {
@@ -39,24 +39,21 @@ def get_account_hierarchy()
39
39
 
40
40
  serviced_account_srv = adwords.service(:ServicedAccountService, API_VERSION)
41
41
 
42
- # Get the account hierarchy for this account.
43
- selector = {
44
- :service_types => ['UI_AND_API', 'API_ONLY'],
45
- :enable_paging => false
46
- }
42
+ # Create selector to get all accounts with no paging.
43
+ selector = {:enable_paging => false}
47
44
 
48
45
  graph = nil
49
46
 
50
47
  # Run with MCC account.
51
48
  adwords.use_mcc do
49
+ # Get the account hierarchy for this account.
52
50
  graph = serviced_account_srv.get(selector)
53
51
  end
54
52
 
55
53
  if graph
56
54
  # Display the accounts.
57
55
  account_number = graph[:accounts] ? graph[:accounts].size : 0
58
- puts "There are %d customers under this account hierarchy." %
59
- account_number
56
+ puts "There are %d customers under this account hierarchy." % account_number
60
57
  if graph[:accounts]
61
58
  graph[:accounts].each_with_index do |account, index|
62
59
  puts "#{index + 1}) Customer id: " +
@@ -71,10 +68,10 @@ def get_account_hierarchy()
71
68
 
72
69
  # Display the links.
73
70
  graph[:links].each do |link|
74
- puts "There is a #{link[:type_of_link]} link of type " +
75
- "#{link[:service_type]} from " +
76
- "#{AdwordsApi::Utils.format_id(link[:manager_id][:id])} to " +
77
- "#{AdwordsApi::Utils.format_id(link[:client_id][:id])}"
71
+ puts "There is a '%s' link from %s to %s" %
72
+ [link[:type_of_link],
73
+ AdwordsApi::Utils.format_id(link[:manager_id][:id]),
74
+ AdwordsApi::Utils.format_id(link[:client_id][:id])]
78
75
  end
79
76
  end
80
77
  else
@@ -44,7 +44,7 @@ def add_ad_group()
44
44
  operation = {
45
45
  :operator => 'ADD',
46
46
  :operand => {
47
- :name => 'Earth to Mars Cruises #%s' % (Time.new.to_f * 1000).to_i,
47
+ :name => "Earth to Mars Cruises #%d" % (Time.new.to_f * 1000).to_i,
48
48
  :status => 'ENABLED',
49
49
  :campaign_id => campaign_id,
50
50
  :bids => {
@@ -64,7 +64,7 @@ def add_ad_group()
64
64
  # Add ad group.
65
65
  response = ad_group_srv.mutate([operation])
66
66
  ad_group = response[:value].first
67
- puts 'Ad group id %d was successfully added.' % ad_group[:id]
67
+ puts "Ad group ID %d was successfully added." % ad_group[:id]
68
68
  end
69
69
 
70
70
  if __FILE__ == $0
@@ -78,7 +78,7 @@ def add_ads()
78
78
  :ad_group_id => ad_group_id,
79
79
  :ad => {
80
80
  :xsi_type => 'ImageAd',
81
- :name => 'Cruise to mars image ad #%s' % (Time.new.to_f * 1000).to_i,
81
+ :name => "Cruise to mars image ad #%d" % (Time.new.to_f * 1000).to_i,
82
82
  :url => 'http://www.example.com',
83
83
  :display_url => 'www.example.com',
84
84
  :image => {
@@ -92,7 +92,7 @@ def add_ads()
92
92
  template_ad_operation = {
93
93
  :operator => 'ADD',
94
94
  :operand => {
95
- :adGroupId => ad_group_id,
95
+ :ad_group_id => ad_group_id,
96
96
  :ad => {
97
97
  :xsi_type => 'TemplateAd',
98
98
  :template_id => 9,
@@ -100,7 +100,7 @@ def add_ads()
100
100
  :width => 300,
101
101
  :height => 250
102
102
  },
103
- :name => 'Mars cruise video ad #%s' % (Time.new.to_f * 1000).to_i,
103
+ :name => "Mars cruise video ad #%d" % (Time.new.to_f * 1000).to_i,
104
104
  :display_url => 'www.example.com',
105
105
  :url => 'http://www.example.com',
106
106
  :template_elements => [{
@@ -144,11 +144,11 @@ def add_ads()
144
144
  ads = response[:value]
145
145
  puts "Added #{ads.length} ad(s) to ad group #{ad_group_id}."
146
146
  ads.each do |ad|
147
- puts " Ad id is #{ad[:ad][:id]}, type is #{ad[:ad][:xsi_type]} and " +
148
- "status is \"#{ad[:status]}\"."
147
+ puts " Ad ID is #{ad[:ad][:id]}, type is '#{ad[:ad][:xsi_type]}' and " +
148
+ "status is '#{ad[:status]}'."
149
149
  end
150
150
  else
151
- puts "No ads were added."
151
+ puts 'No ads were added.'
152
152
  end
153
153
  end
154
154
 
@@ -41,7 +41,7 @@ def add_campaign()
41
41
  operation = {
42
42
  :operator => 'ADD',
43
43
  :operand => {
44
- :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,
44
+ :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i,
45
45
  :status => 'PAUSED',
46
46
  :bidding_strategy => {
47
47
  # The 'xsi_type' field allows you to specify the xsi:type of the object
@@ -70,7 +70,7 @@ def add_campaign()
70
70
  response = campaign_srv.mutate([operation])
71
71
  if response and response[:value]
72
72
  campaign = response[:value].first
73
- puts 'Campaign with name "%s" and id %d was added.' %
73
+ puts "Campaign with name '%s' and ID %d was added." %
74
74
  [campaign[:name], campaign[:id]]
75
75
  else
76
76
  puts 'No campaigns were added.'
@@ -45,7 +45,7 @@ def add_conversion()
45
45
  # being created. It's only necessary when you must provide an explicit
46
46
  # type that the client library can't infer.
47
47
  :xsi_type => 'AdWordsConversionTracker',
48
- :name => 'Earth to Mars Cruises Conversion #%s' %
48
+ :name => "Earth to Mars Cruises Conversion #%d" %
49
49
  (Time.new.to_f * 1000).to_i,
50
50
  :category => 'DEFAULT',
51
51
  :markup_language => 'HTML',
@@ -58,9 +58,9 @@ def add_conversion()
58
58
  response = conv_tracker_srv.mutate([operation])
59
59
  if response and response[:value]
60
60
  conversion = response[:value].first
61
- puts "Conversion with id #{conversion[:id]}, name " +
62
- "\"#{conversion[:name]}\", status \"#{conversion[:status]}\" and " +
63
- " category \"#{conversion[:category]}\" was added."
61
+ puts "Conversion with ID #{conversion[:id]}, name " +
62
+ "'#{conversion[:name]}', status '#{conversion[:status]}' and " +
63
+ " category '#{conversion[:category]}' was added."
64
64
  else
65
65
  puts 'No conversions were added.'
66
66
  end
@@ -53,16 +53,16 @@ def add_experiment()
53
53
  :operator => 'ADD',
54
54
  :operand => {
55
55
  :campaign_id => campaign_id,
56
- :name => 'Interplanetary Experiment #%s' % (Time.new.to_f * 1000).to_i,
56
+ :name => "Interplanetary Experiment #%d" % (Time.new.to_f * 1000).to_i,
57
57
  :query_percentage => 10,
58
- :start_date_time => Time.now.strftime("%Y%m%d %H%M%S")
58
+ :start_date_time => Time.now.strftime('%Y%m%d %H%M%S')
59
59
  }
60
60
  }
61
61
 
62
62
  # Add experiment.
63
63
  response = experiment_srv.mutate([operation])
64
64
  experiment = response[:value].first
65
- puts 'Experiment with name "%s" and id %d was added.' %
65
+ puts "Experiment with name '%s' and ID %d was added." %
66
66
  [experiment[:name], experiment[:id]]
67
67
 
68
68
  experiment_id = experiment[:id]
@@ -93,7 +93,7 @@ def add_experiment()
93
93
  # Update ad group.
94
94
  response = ad_group_srv.mutate([operation])
95
95
  ad_group = response[:value].first
96
- puts 'Ad group id %d was updated for the experiment.' % ad_group[:id]
96
+ puts "Ad group ID %d was updated for the experiment." % ad_group[:id]
97
97
 
98
98
  # Setup ad group criterion for the experiment.
99
99
  ad_group_criterion = {
@@ -126,7 +126,7 @@ def add_experiment()
126
126
  # Update criterion.
127
127
  response = ad_group_criterion_srv.mutate([operation])
128
128
  criterion = response[:value].first
129
- puts 'Criterion id %d was successfully updated for the experiment.' %
129
+ puts "Criterion ID %d was successfully updated for the experiment." %
130
130
  [criterion[:criterion][:id]]
131
131
 
132
132
  end
@@ -59,7 +59,7 @@ def add_keywords_performance_report_definition()
59
59
  :max => end_date
60
60
  }
61
61
  },
62
- :report_name => 'Keywords performance report #%s' %
62
+ :report_name => "Keywords performance report #%d" %
63
63
  (Time.new.to_f * 1000).to_i,
64
64
  :report_type => 'KEYWORDS_PERFORMANCE_REPORT',
65
65
  :date_range_type => 'CUSTOM_DATE',
@@ -71,7 +71,7 @@ def add_keywords_performance_report_definition()
71
71
  response = report_def_srv.mutate([operation])
72
72
  if response
73
73
  response.each do |report_definition|
74
- puts 'Report definition with name \'%s\' and id \'%s\' was added' %
74
+ puts "Report definition with name '%s' and ID %d was added." %
75
75
  [report_definition[:report_name], report_definition[:id]]
76
76
  end
77
77
  end
@@ -40,7 +40,7 @@ def add_user_list()
40
40
  conv_tracker_srv = adwords.service(:ConversionTrackerService, API_VERSION)
41
41
 
42
42
  # Prepare for adding remarketing user list.
43
- name = 'Mars cruise customers #%s' % (Time.new.to_f * 1000).to_i
43
+ name = "Mars cruise customers #%d" % (Time.new.to_f * 1000).to_i
44
44
  operation = {
45
45
  :operator => 'ADD',
46
46
  :operand => {
@@ -77,12 +77,12 @@ def add_user_list()
77
77
  conversions = conv_tracker_response[:entries]
78
78
  end
79
79
  end
80
- puts 'User list with name "%s" and id %d was added.' %
80
+ puts "User list with name '%s' and ID %d was added." %
81
81
  [user_list[:name], user_list[:id]]
82
82
  # Display user list associated conversion code snippets.
83
83
  if conversions
84
84
  conversions.each do |conversion|
85
- puts "Conversion type code snipped associated to the list:\n%s\n" %
85
+ puts "Conversion type code snipped associated to the list:\n\t\t%s\n" %
86
86
  conversion[:snippet]
87
87
  end
88
88
  end
@@ -45,7 +45,7 @@ def check_campaigns()
45
45
  operation = {
46
46
  :operator => 'ADD',
47
47
  :operand => {
48
- :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,
48
+ :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i,
49
49
  :status => 'PAUSED',
50
50
  :bidding_strategy => {
51
51
  # The 'xsi_type' field allows you to specify the xsi:type of the object
@@ -68,8 +68,8 @@ def check_campaigns()
68
68
  if response and response[:value]
69
69
  campaigns = response[:value]
70
70
  campaigns.each do |campaign|
71
- puts "Unexpected campaign creation! Name \"#{campaign[:name]}\", id " +
72
- "#{campaign[:id]} and status is \"#{campaign[:status]}\"."
71
+ puts "Unexpected campaign creation! Name '#{campaign[:name]}', ID " +
72
+ "#{campaign[:id]} and status is '#{campaign[:status]}'."
73
73
  end
74
74
  else
75
75
  puts 'No campaigns created.'
@@ -80,7 +80,7 @@ def check_campaigns()
80
80
  operation = {
81
81
  :operator => 'ADD',
82
82
  :operand => {
83
- :name => 'Interplanetary Cruise #%s' % (Time.new.to_f * 1000).to_i,
83
+ :name => "Interplanetary Cruise #%d" % (Time.new.to_f * 1000).to_i,
84
84
  :status => 'PAUSED',
85
85
  :bidding_strategy => nil,
86
86
  :budget => {
@@ -39,16 +39,14 @@ def get_account_hierarchy()
39
39
 
40
40
  serviced_account_srv = adwords.service(:ServicedAccountService, API_VERSION)
41
41
 
42
- # Get the account hierarchy for this account.
43
- selector = {
44
- :service_types => ['UI_AND_API', 'API_ONLY'],
45
- :enable_paging => false
46
- }
42
+ # Create selector to get all accounts with no paging.
43
+ selector = {:enable_paging => false}
47
44
 
48
45
  graph = nil
49
46
 
50
47
  # Run with MCC account.
51
48
  adwords.use_mcc do
49
+ # Get the account hierarchy for this account.
52
50
  graph = serviced_account_srv.get(selector)
53
51
  end
54
52
 
@@ -71,10 +69,10 @@ def get_account_hierarchy()
71
69
 
72
70
  # Display the links.
73
71
  graph[:links].each do |link|
74
- puts "There is a #{link[:type_of_link]} link of type " +
75
- "#{link[:service_type]} from " +
76
- "#{AdwordsApi::Utils.format_id(link[:manager_id][:id])} to " +
77
- "#{AdwordsApi::Utils.format_id(link[:client_id][:id])}"
72
+ puts "There is a '%s' link from %s to %s" %
73
+ [link[:type_of_link],
74
+ AdwordsApi::Utils.format_id(link[:manager_id][:id]),
75
+ AdwordsApi::Utils.format_id(link[:client_id][:id])]
78
76
  end
79
77
  end
80
78
  else
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Author:: api.sgomes@gmail.com (Sérgio Gomes)
4
+ #
5
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
6
+ #
7
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16
+ # implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+ # This example illustrates override an ad extension for a specific ad, by
21
+ # creating an ad extension override. To create a campaign, run add_campaign.rb.
22
+ # To create an ad, run add_ads.rb.
23
+ #
24
+ # Tags: AdExtensionOverrideService.mutate
25
+
26
+ require 'rubygems'
27
+ require 'adwords_api'
28
+
29
+ API_VERSION = :v201109
30
+
31
+ def add_ad_extension_override()
32
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
33
+ # when called without parameters.
34
+ adwords = AdwordsApi::Api.new
35
+
36
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
37
+ # the configuration file or provide your own logger:
38
+ # adwords.logger = Logger.new('adwords_xml.log')
39
+
40
+ ad_ext_override_srv =
41
+ adwords.service(:AdExtensionOverrideService, API_VERSION)
42
+
43
+ ad_id = 'INSERT_AD_ID_HERE'.to_i
44
+ campaign_ad_extension_id = 'INSERT_CAMPAIGN_AD_EXTENSION_ID_HERE'.to_i
45
+
46
+ # Create operation.
47
+ operation = {
48
+ :operator => 'ADD',
49
+ :operand => {
50
+ :ad_id => ad_id,
51
+ :ad_extension => {
52
+ :id => campaign_ad_extension_id
53
+ }
54
+ }
55
+ }
56
+
57
+ # Add override.
58
+ response = ad_ext_override_srv.mutate([operation])
59
+ ad_ext_override = response[:value].first
60
+ puts 'Ad extension override was successfully added.'
61
+ end
62
+
63
+ if __FILE__ == $0
64
+ begin
65
+ add_ad_extension_override()
66
+
67
+ # HTTP errors.
68
+ rescue AdsCommon::Errors::HttpError => e
69
+ puts "HTTP Error: %s" % e
70
+
71
+ # API errors.
72
+ rescue AdwordsApi::Errors::ApiException => e
73
+ puts "Message: %s" % e.message
74
+ puts 'Errors:'
75
+ e.errors.each_with_index do |error, index|
76
+ puts "\tError [%d]:" % (index + 1)
77
+ error.each do |field, value|
78
+ puts "\t\t%s: %s" % [field, value]
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/ruby
2
+ #
3
+ # Author:: api.sgomes@gmail.com (Sérgio Gomes)
4
+ #
5
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
6
+ #
7
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
16
+ # implied.
17
+ # See the License for the specific language governing permissions and
18
+ # limitations under the License.
19
+ #
20
+ # This example illustrates how to create an ad group. To create a campaign, run
21
+ # add_campaign.rb.
22
+ #
23
+ # Tags: AdGroupService.mutate
24
+
25
+ require 'rubygems'
26
+ require 'adwords_api'
27
+
28
+ API_VERSION = :v201109
29
+
30
+ def add_ad_group()
31
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
32
+ # when called without parameters.
33
+ adwords = AdwordsApi::Api.new
34
+
35
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
36
+ # the configuration file or provide your own logger:
37
+ # adwords.logger = Logger.new('adwords_xml.log')
38
+
39
+ ad_group_srv = adwords.service(:AdGroupService, API_VERSION)
40
+
41
+ campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
42
+
43
+ # Prepare for adding ad group.
44
+ operation = {
45
+ :operator => 'ADD',
46
+ :operand => {
47
+ :name => "Earth to Mars Cruises #%d" % (Time.new.to_f * 1000).to_i,
48
+ :status => 'ENABLED',
49
+ :campaign_id => campaign_id,
50
+ :bids => {
51
+ # The 'xsi_type' field allows you to specify the xsi:type of the object
52
+ # being created. It's only necessary when you must provide an explicit
53
+ # type that the client library can't infer.
54
+ :xsi_type => 'ManualCPCAdGroupBids',
55
+ :keyword_max_cpc => {
56
+ :amount => {
57
+ :micro_amount => 10000000
58
+ }
59
+ }
60
+ },
61
+ }
62
+ }
63
+
64
+ # Add ad group.
65
+ response = ad_group_srv.mutate([operation])
66
+ ad_group = response[:value].first
67
+ puts "Ad group ID %d was successfully added." % ad_group[:id]
68
+ end
69
+
70
+ if __FILE__ == $0
71
+ begin
72
+ add_ad_group()
73
+
74
+ # HTTP errors.
75
+ rescue AdsCommon::Errors::HttpError => e
76
+ puts "HTTP Error: %s" % e
77
+
78
+ # API errors.
79
+ rescue AdwordsApi::Errors::ApiException => e
80
+ puts "Message: %s" % e.message
81
+ puts 'Errors:'
82
+ e.errors.each_with_index do |error, index|
83
+ puts "\tError [%d]:" % (index + 1)
84
+ error.each do |field, value|
85
+ puts "\t\t%s: %s" % [field, value]
86
+ end
87
+ end
88
+ end
89
+ end