google-adwords-api 0.13.1 → 0.13.2

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 (319) hide show
  1. checksums.yaml +15 -0
  2. data/COPYING +0 -0
  3. data/ChangeLog +3 -0
  4. data/README.md +0 -0
  5. data/adwords_api.yml +0 -0
  6. data/examples/v201402/misc/create_ad_words_session_without_properties_file.rb +0 -0
  7. data/examples/v201402/shopping_campaigns/add_product_partition_tree.rb +0 -0
  8. data/examples/v201402/shopping_campaigns/add_product_scope.rb +0 -0
  9. data/examples/v201402/shopping_campaigns/add_shopping_campaign.rb +0 -0
  10. data/examples/v201402/shopping_campaigns/get_product_category_taxonomy.rb +0 -0
  11. data/examples/v201402/shopping_campaigns/set_product_sales_channel.rb +0 -0
  12. data/examples/v201406/advanced_operations/add_places_location_extensions.rb +1 -2
  13. data/examples/v201409/account_management/create_account.rb +92 -0
  14. data/examples/v201409/account_management/get_account_changes.rb +145 -0
  15. data/examples/v201409/account_management/get_account_hierarchy.rb +102 -0
  16. data/examples/v201409/advanced_operations/add_ad_customizer.rb +277 -0
  17. data/examples/v201409/advanced_operations/add_ad_group_bid_modifier.rb +105 -0
  18. data/examples/v201409/advanced_operations/add_click_to_download_ad.rb +137 -0
  19. data/examples/v201409/advanced_operations/add_places_location_extensions.rb +158 -0
  20. data/examples/v201409/advanced_operations/add_site_links.rb +306 -0
  21. data/examples/v201409/advanced_operations/add_text_ad_with_upgraded_urls.rb +137 -0
  22. data/examples/v201409/advanced_operations/get_ad_group_bid_modifiers.rb +106 -0
  23. data/examples/v201409/advanced_operations/update_site_links.rb +194 -0
  24. data/examples/v201409/advanced_operations/upload_offline_conversions.rb +117 -0
  25. data/examples/v201409/advanced_operations/use_shared_bidding_strategy.rb +164 -0
  26. data/examples/v201409/basic_operations/add_ad_groups.rb +142 -0
  27. data/examples/v201409/basic_operations/add_campaigns.rb +153 -0
  28. data/examples/v201409/basic_operations/add_keywords.rb +116 -0
  29. data/examples/v201409/basic_operations/add_text_ads.rb +113 -0
  30. data/examples/v201409/basic_operations/get_ad_groups.rb +106 -0
  31. data/examples/v201409/basic_operations/get_campaigns.rb +101 -0
  32. data/examples/v201409/basic_operations/get_campaigns_with_awql.rb +93 -0
  33. data/examples/v201409/basic_operations/get_keywords.rb +112 -0
  34. data/examples/v201409/basic_operations/get_text_ads.rb +114 -0
  35. data/examples/v201409/basic_operations/pause_ad.rb +92 -0
  36. data/examples/v201409/basic_operations/remove_ad.rb +93 -0
  37. data/examples/v201409/basic_operations/remove_ad_group.rb +89 -0
  38. data/examples/v201409/basic_operations/remove_campaign.rb +91 -0
  39. data/examples/v201409/basic_operations/remove_keyword.rb +98 -0
  40. data/examples/v201409/basic_operations/update_ad_group.rb +89 -0
  41. data/examples/v201409/basic_operations/update_campaign.rb +90 -0
  42. data/examples/v201409/basic_operations/update_keyword.rb +110 -0
  43. data/examples/v201409/campaign_management/add_campaign_labels.rb +86 -0
  44. data/examples/v201409/campaign_management/add_experiment.rb +166 -0
  45. data/examples/v201409/campaign_management/add_keywords_in_bulk.rb +158 -0
  46. data/examples/v201409/campaign_management/add_location_extension.rb +125 -0
  47. data/examples/v201409/campaign_management/get_all_disapproved_ads.rb +101 -0
  48. data/examples/v201409/campaign_management/get_all_disapproved_ads_with_awql.rb +93 -0
  49. data/examples/v201409/campaign_management/get_campaigns_by_label.rb +112 -0
  50. data/examples/v201409/campaign_management/promote_experiment.rb +85 -0
  51. data/examples/v201409/campaign_management/set_ad_parameters.rb +122 -0
  52. data/examples/v201409/campaign_management/set_criterion_bid_modifier.rb +108 -0
  53. data/examples/v201409/campaign_management/validate_text_ad.rb +114 -0
  54. data/examples/v201409/error_handling/handle_captcha_challenge.rb +93 -0
  55. data/examples/v201409/error_handling/handle_partial_failures.rb +134 -0
  56. data/examples/v201409/error_handling/handle_policy_violation_error.rb +145 -0
  57. data/examples/v201409/error_handling/handle_two_factor_authorization_error.rb +88 -0
  58. data/examples/v201409/misc/create_ad_words_session_without_properties_file.rb +94 -0
  59. data/examples/v201409/misc/get_all_images_and_videos.rb +108 -0
  60. data/examples/v201409/misc/setup_oauth2.rb +88 -0
  61. data/examples/v201409/misc/upload_image.rb +97 -0
  62. data/examples/v201409/misc/use_oauth2_jwt.rb +97 -0
  63. data/examples/v201409/optimization/estimate_keyword_traffic.rb +137 -0
  64. data/examples/v201409/optimization/get_keyword_bid_simulations.rb +100 -0
  65. data/examples/v201409/optimization/get_keyword_ideas.rb +130 -0
  66. data/examples/v201409/remarketing/add_audience.rb +123 -0
  67. data/examples/v201409/remarketing/add_conversion_tracker.rb +105 -0
  68. data/examples/v201409/reporting/download_criteria_report.rb +87 -0
  69. data/examples/v201409/reporting/download_criteria_report_with_awql.rb +86 -0
  70. data/examples/v201409/reporting/get_report_fields.rb +79 -0
  71. data/examples/v201409/reporting/parallel_report_download.rb +171 -0
  72. data/examples/v201409/shopping_campaigns/add_product_partition_tree.rb +269 -0
  73. data/examples/v201409/shopping_campaigns/add_product_scope.rb +133 -0
  74. data/examples/v201409/shopping_campaigns/add_shopping_campaign.rb +135 -0
  75. data/examples/v201409/shopping_campaigns/get_product_category_taxonomy.rb +117 -0
  76. data/examples/v201409/targeting/add_campaign_targeting_criteria.rb +173 -0
  77. data/examples/v201409/targeting/add_demographic_targeting_criteria.rb +116 -0
  78. data/examples/v201409/targeting/get_campaign_targeting_criteria.rb +110 -0
  79. data/examples/v201409/targeting/get_targetable_languages_and_carriers.rb +94 -0
  80. data/examples/v201409/targeting/lookup_location.rb +112 -0
  81. data/lib/adwords_api.rb +18 -0
  82. data/lib/adwords_api/api_config.rb +82 -4
  83. data/lib/adwords_api/credential_handler.rb +0 -0
  84. data/lib/adwords_api/errors.rb +0 -0
  85. data/lib/adwords_api/report_header_handler.rb +8 -0
  86. data/lib/adwords_api/report_utils.rb +0 -0
  87. data/lib/adwords_api/utils.rb +0 -0
  88. data/lib/adwords_api/v201402/ad_group_ad_service.rb +0 -0
  89. data/lib/adwords_api/v201402/ad_group_ad_service_registry.rb +0 -0
  90. data/lib/adwords_api/v201402/ad_group_bid_modifier_service.rb +0 -0
  91. data/lib/adwords_api/v201402/ad_group_bid_modifier_service_registry.rb +0 -0
  92. data/lib/adwords_api/v201402/ad_group_criterion_service.rb +0 -0
  93. data/lib/adwords_api/v201402/ad_group_criterion_service_registry.rb +0 -0
  94. data/lib/adwords_api/v201402/ad_group_feed_service.rb +0 -0
  95. data/lib/adwords_api/v201402/ad_group_feed_service_registry.rb +0 -0
  96. data/lib/adwords_api/v201402/ad_group_service.rb +0 -0
  97. data/lib/adwords_api/v201402/ad_group_service_registry.rb +0 -0
  98. data/lib/adwords_api/v201402/ad_param_service.rb +0 -0
  99. data/lib/adwords_api/v201402/ad_param_service_registry.rb +0 -0
  100. data/lib/adwords_api/v201402/adwords_user_list_service.rb +0 -0
  101. data/lib/adwords_api/v201402/adwords_user_list_service_registry.rb +0 -0
  102. data/lib/adwords_api/v201402/alert_service.rb +0 -0
  103. data/lib/adwords_api/v201402/alert_service_registry.rb +0 -0
  104. data/lib/adwords_api/v201402/bidding_strategy_service.rb +0 -0
  105. data/lib/adwords_api/v201402/bidding_strategy_service_registry.rb +0 -0
  106. data/lib/adwords_api/v201402/budget_order_service.rb +0 -0
  107. data/lib/adwords_api/v201402/budget_order_service_registry.rb +0 -0
  108. data/lib/adwords_api/v201402/budget_service.rb +0 -0
  109. data/lib/adwords_api/v201402/budget_service_registry.rb +0 -0
  110. data/lib/adwords_api/v201402/campaign_ad_extension_service.rb +0 -0
  111. data/lib/adwords_api/v201402/campaign_ad_extension_service_registry.rb +0 -0
  112. data/lib/adwords_api/v201402/campaign_criterion_service.rb +0 -0
  113. data/lib/adwords_api/v201402/campaign_criterion_service_registry.rb +0 -0
  114. data/lib/adwords_api/v201402/campaign_feed_service.rb +0 -0
  115. data/lib/adwords_api/v201402/campaign_feed_service_registry.rb +0 -0
  116. data/lib/adwords_api/v201402/campaign_service.rb +0 -0
  117. data/lib/adwords_api/v201402/campaign_service_registry.rb +0 -0
  118. data/lib/adwords_api/v201402/campaign_shared_set_service.rb +0 -0
  119. data/lib/adwords_api/v201402/campaign_shared_set_service_registry.rb +0 -0
  120. data/lib/adwords_api/v201402/constant_data_service.rb +0 -0
  121. data/lib/adwords_api/v201402/constant_data_service_registry.rb +0 -0
  122. data/lib/adwords_api/v201402/conversion_tracker_service.rb +0 -0
  123. data/lib/adwords_api/v201402/conversion_tracker_service_registry.rb +0 -0
  124. data/lib/adwords_api/v201402/customer_feed_service.rb +0 -0
  125. data/lib/adwords_api/v201402/customer_feed_service_registry.rb +0 -0
  126. data/lib/adwords_api/v201402/customer_service.rb +0 -0
  127. data/lib/adwords_api/v201402/customer_service_registry.rb +0 -0
  128. data/lib/adwords_api/v201402/customer_sync_service.rb +0 -0
  129. data/lib/adwords_api/v201402/customer_sync_service_registry.rb +0 -0
  130. data/lib/adwords_api/v201402/data_service.rb +0 -0
  131. data/lib/adwords_api/v201402/data_service_registry.rb +0 -0
  132. data/lib/adwords_api/v201402/experiment_service.rb +0 -0
  133. data/lib/adwords_api/v201402/experiment_service_registry.rb +0 -0
  134. data/lib/adwords_api/v201402/feed_item_service.rb +0 -0
  135. data/lib/adwords_api/v201402/feed_item_service_registry.rb +0 -0
  136. data/lib/adwords_api/v201402/feed_mapping_service.rb +0 -0
  137. data/lib/adwords_api/v201402/feed_mapping_service_registry.rb +0 -0
  138. data/lib/adwords_api/v201402/feed_service.rb +0 -0
  139. data/lib/adwords_api/v201402/feed_service_registry.rb +0 -0
  140. data/lib/adwords_api/v201402/geo_location_service.rb +0 -0
  141. data/lib/adwords_api/v201402/geo_location_service_registry.rb +0 -0
  142. data/lib/adwords_api/v201402/location_criterion_service.rb +0 -0
  143. data/lib/adwords_api/v201402/location_criterion_service_registry.rb +0 -0
  144. data/lib/adwords_api/v201402/managed_customer_service.rb +0 -0
  145. data/lib/adwords_api/v201402/managed_customer_service_registry.rb +0 -0
  146. data/lib/adwords_api/v201402/media_service.rb +0 -0
  147. data/lib/adwords_api/v201402/media_service_registry.rb +0 -0
  148. data/lib/adwords_api/v201402/mutate_job_service.rb +0 -0
  149. data/lib/adwords_api/v201402/mutate_job_service_registry.rb +0 -0
  150. data/lib/adwords_api/v201402/offline_conversion_feed_service.rb +0 -0
  151. data/lib/adwords_api/v201402/offline_conversion_feed_service_registry.rb +0 -0
  152. data/lib/adwords_api/v201402/report_definition_service.rb +0 -0
  153. data/lib/adwords_api/v201402/report_definition_service_registry.rb +0 -0
  154. data/lib/adwords_api/v201402/shared_criterion_service.rb +0 -0
  155. data/lib/adwords_api/v201402/shared_criterion_service_registry.rb +0 -0
  156. data/lib/adwords_api/v201402/shared_set_service.rb +0 -0
  157. data/lib/adwords_api/v201402/shared_set_service_registry.rb +0 -0
  158. data/lib/adwords_api/v201402/targeting_idea_service.rb +0 -0
  159. data/lib/adwords_api/v201402/targeting_idea_service_registry.rb +0 -0
  160. data/lib/adwords_api/v201402/traffic_estimator_service.rb +0 -0
  161. data/lib/adwords_api/v201402/traffic_estimator_service_registry.rb +0 -0
  162. data/lib/adwords_api/v201406/ad_group_ad_service.rb +1 -1
  163. data/lib/adwords_api/v201406/ad_group_ad_service_registry.rb +1 -1
  164. data/lib/adwords_api/v201406/ad_group_bid_modifier_service.rb +1 -1
  165. data/lib/adwords_api/v201406/ad_group_bid_modifier_service_registry.rb +1 -1
  166. data/lib/adwords_api/v201406/ad_group_criterion_service.rb +1 -1
  167. data/lib/adwords_api/v201406/ad_group_criterion_service_registry.rb +1 -1
  168. data/lib/adwords_api/v201406/ad_group_feed_service.rb +1 -1
  169. data/lib/adwords_api/v201406/ad_group_feed_service_registry.rb +1 -1
  170. data/lib/adwords_api/v201406/ad_group_service.rb +1 -1
  171. data/lib/adwords_api/v201406/ad_group_service_registry.rb +1 -1
  172. data/lib/adwords_api/v201406/ad_param_service.rb +1 -1
  173. data/lib/adwords_api/v201406/ad_param_service_registry.rb +1 -1
  174. data/lib/adwords_api/v201406/adwords_user_list_service.rb +1 -1
  175. data/lib/adwords_api/v201406/adwords_user_list_service_registry.rb +1 -1
  176. data/lib/adwords_api/v201406/alert_service.rb +1 -1
  177. data/lib/adwords_api/v201406/alert_service_registry.rb +1 -1
  178. data/lib/adwords_api/v201406/bidding_strategy_service.rb +1 -1
  179. data/lib/adwords_api/v201406/bidding_strategy_service_registry.rb +1 -1
  180. data/lib/adwords_api/v201406/budget_order_service.rb +1 -1
  181. data/lib/adwords_api/v201406/budget_order_service_registry.rb +1 -1
  182. data/lib/adwords_api/v201406/budget_service.rb +1 -1
  183. data/lib/adwords_api/v201406/budget_service_registry.rb +1 -1
  184. data/lib/adwords_api/v201406/campaign_ad_extension_service.rb +1 -1
  185. data/lib/adwords_api/v201406/campaign_ad_extension_service_registry.rb +1 -1
  186. data/lib/adwords_api/v201406/campaign_criterion_service.rb +1 -1
  187. data/lib/adwords_api/v201406/campaign_criterion_service_registry.rb +1 -1
  188. data/lib/adwords_api/v201406/campaign_feed_service.rb +1 -1
  189. data/lib/adwords_api/v201406/campaign_feed_service_registry.rb +1 -1
  190. data/lib/adwords_api/v201406/campaign_service.rb +1 -1
  191. data/lib/adwords_api/v201406/campaign_service_registry.rb +2 -2
  192. data/lib/adwords_api/v201406/campaign_shared_set_service.rb +0 -0
  193. data/lib/adwords_api/v201406/campaign_shared_set_service_registry.rb +0 -0
  194. data/lib/adwords_api/v201406/constant_data_service.rb +1 -1
  195. data/lib/adwords_api/v201406/constant_data_service_registry.rb +1 -1
  196. data/lib/adwords_api/v201406/conversion_tracker_service.rb +1 -1
  197. data/lib/adwords_api/v201406/conversion_tracker_service_registry.rb +1 -1
  198. data/lib/adwords_api/v201406/customer_feed_service.rb +1 -1
  199. data/lib/adwords_api/v201406/customer_feed_service_registry.rb +1 -1
  200. data/lib/adwords_api/v201406/customer_service.rb +1 -1
  201. data/lib/adwords_api/v201406/customer_service_registry.rb +1 -1
  202. data/lib/adwords_api/v201406/customer_sync_service.rb +1 -1
  203. data/lib/adwords_api/v201406/customer_sync_service_registry.rb +1 -1
  204. data/lib/adwords_api/v201406/data_service.rb +1 -1
  205. data/lib/adwords_api/v201406/data_service_registry.rb +1 -1
  206. data/lib/adwords_api/v201406/experiment_service.rb +1 -1
  207. data/lib/adwords_api/v201406/experiment_service_registry.rb +1 -1
  208. data/lib/adwords_api/v201406/feed_item_service.rb +1 -1
  209. data/lib/adwords_api/v201406/feed_item_service_registry.rb +1 -1
  210. data/lib/adwords_api/v201406/feed_mapping_service.rb +1 -1
  211. data/lib/adwords_api/v201406/feed_mapping_service_registry.rb +1 -1
  212. data/lib/adwords_api/v201406/feed_service.rb +1 -1
  213. data/lib/adwords_api/v201406/feed_service_registry.rb +1 -1
  214. data/lib/adwords_api/v201406/geo_location_service.rb +1 -1
  215. data/lib/adwords_api/v201406/geo_location_service_registry.rb +1 -1
  216. data/lib/adwords_api/v201406/label_service.rb +0 -0
  217. data/lib/adwords_api/v201406/label_service_registry.rb +0 -0
  218. data/lib/adwords_api/v201406/location_criterion_service.rb +1 -1
  219. data/lib/adwords_api/v201406/location_criterion_service_registry.rb +1 -1
  220. data/lib/adwords_api/v201406/managed_customer_service.rb +1 -1
  221. data/lib/adwords_api/v201406/managed_customer_service_registry.rb +1 -1
  222. data/lib/adwords_api/v201406/media_service.rb +1 -1
  223. data/lib/adwords_api/v201406/media_service_registry.rb +1 -1
  224. data/lib/adwords_api/v201406/mutate_job_service.rb +1 -1
  225. data/lib/adwords_api/v201406/mutate_job_service_registry.rb +1 -1
  226. data/lib/adwords_api/v201406/offline_conversion_feed_service.rb +1 -1
  227. data/lib/adwords_api/v201406/offline_conversion_feed_service_registry.rb +1 -1
  228. data/lib/adwords_api/v201406/report_definition_service.rb +1 -1
  229. data/lib/adwords_api/v201406/report_definition_service_registry.rb +1 -1
  230. data/lib/adwords_api/v201406/shared_criterion_service.rb +0 -0
  231. data/lib/adwords_api/v201406/shared_criterion_service_registry.rb +0 -0
  232. data/lib/adwords_api/v201406/shared_set_service.rb +0 -0
  233. data/lib/adwords_api/v201406/shared_set_service_registry.rb +0 -0
  234. data/lib/adwords_api/v201406/targeting_idea_service.rb +1 -1
  235. data/lib/adwords_api/v201406/targeting_idea_service_registry.rb +1 -1
  236. data/lib/adwords_api/v201406/traffic_estimator_service.rb +1 -1
  237. data/lib/adwords_api/v201406/traffic_estimator_service_registry.rb +1 -1
  238. data/lib/adwords_api/v201409/ad_group_ad_service.rb +50 -0
  239. data/lib/adwords_api/v201409/ad_group_ad_service_registry.rb +46 -0
  240. data/lib/adwords_api/v201409/ad_group_bid_modifier_service.rb +42 -0
  241. data/lib/adwords_api/v201409/ad_group_bid_modifier_service_registry.rb +46 -0
  242. data/lib/adwords_api/v201409/ad_group_criterion_service.rb +46 -0
  243. data/lib/adwords_api/v201409/ad_group_criterion_service_registry.rb +46 -0
  244. data/lib/adwords_api/v201409/ad_group_feed_service.rb +42 -0
  245. data/lib/adwords_api/v201409/ad_group_feed_service_registry.rb +46 -0
  246. data/lib/adwords_api/v201409/ad_group_service.rb +46 -0
  247. data/lib/adwords_api/v201409/ad_group_service_registry.rb +46 -0
  248. data/lib/adwords_api/v201409/ad_param_service.rb +38 -0
  249. data/lib/adwords_api/v201409/ad_param_service_registry.rb +46 -0
  250. data/lib/adwords_api/v201409/adwords_user_list_service.rb +38 -0
  251. data/lib/adwords_api/v201409/adwords_user_list_service_registry.rb +46 -0
  252. data/lib/adwords_api/v201409/bidding_strategy_service.rb +42 -0
  253. data/lib/adwords_api/v201409/bidding_strategy_service_registry.rb +46 -0
  254. data/lib/adwords_api/v201409/budget_order_service.rb +42 -0
  255. data/lib/adwords_api/v201409/budget_order_service_registry.rb +46 -0
  256. data/lib/adwords_api/v201409/budget_service.rb +42 -0
  257. data/lib/adwords_api/v201409/budget_service_registry.rb +46 -0
  258. data/lib/adwords_api/v201409/campaign_ad_extension_service.rb +38 -0
  259. data/lib/adwords_api/v201409/campaign_ad_extension_service_registry.rb +46 -0
  260. data/lib/adwords_api/v201409/campaign_criterion_service.rb +42 -0
  261. data/lib/adwords_api/v201409/campaign_criterion_service_registry.rb +46 -0
  262. data/lib/adwords_api/v201409/campaign_feed_service.rb +42 -0
  263. data/lib/adwords_api/v201409/campaign_feed_service_registry.rb +46 -0
  264. data/lib/adwords_api/v201409/campaign_service.rb +46 -0
  265. data/lib/adwords_api/v201409/campaign_service_registry.rb +46 -0
  266. data/lib/adwords_api/v201409/campaign_shared_set_service.rb +38 -0
  267. data/lib/adwords_api/v201409/campaign_shared_set_service_registry.rb +47 -0
  268. data/lib/adwords_api/v201409/constant_data_service.rb +66 -0
  269. data/lib/adwords_api/v201409/constant_data_service_registry.rb +46 -0
  270. data/lib/adwords_api/v201409/conversion_tracker_service.rb +38 -0
  271. data/lib/adwords_api/v201409/conversion_tracker_service_registry.rb +46 -0
  272. data/lib/adwords_api/v201409/customer_feed_service.rb +42 -0
  273. data/lib/adwords_api/v201409/customer_feed_service_registry.rb +46 -0
  274. data/lib/adwords_api/v201409/customer_service.rb +38 -0
  275. data/lib/adwords_api/v201409/customer_service_registry.rb +46 -0
  276. data/lib/adwords_api/v201409/customer_sync_service.rb +34 -0
  277. data/lib/adwords_api/v201409/customer_sync_service_registry.rb +47 -0
  278. data/lib/adwords_api/v201409/data_service.rb +54 -0
  279. data/lib/adwords_api/v201409/data_service_registry.rb +46 -0
  280. data/lib/adwords_api/v201409/experiment_service.rb +38 -0
  281. data/lib/adwords_api/v201409/experiment_service_registry.rb +46 -0
  282. data/lib/adwords_api/v201409/feed_item_service.rb +42 -0
  283. data/lib/adwords_api/v201409/feed_item_service_registry.rb +46 -0
  284. data/lib/adwords_api/v201409/feed_mapping_service.rb +42 -0
  285. data/lib/adwords_api/v201409/feed_mapping_service_registry.rb +46 -0
  286. data/lib/adwords_api/v201409/feed_service.rb +42 -0
  287. data/lib/adwords_api/v201409/feed_service_registry.rb +46 -0
  288. data/lib/adwords_api/v201409/geo_location_service.rb +34 -0
  289. data/lib/adwords_api/v201409/geo_location_service_registry.rb +46 -0
  290. data/lib/adwords_api/v201409/label_service.rb +42 -0
  291. data/lib/adwords_api/v201409/label_service_registry.rb +46 -0
  292. data/lib/adwords_api/v201409/location_criterion_service.rb +38 -0
  293. data/lib/adwords_api/v201409/location_criterion_service_registry.rb +46 -0
  294. data/lib/adwords_api/v201409/managed_customer_service.rb +50 -0
  295. data/lib/adwords_api/v201409/managed_customer_service_registry.rb +46 -0
  296. data/lib/adwords_api/v201409/media_service.rb +42 -0
  297. data/lib/adwords_api/v201409/media_service_registry.rb +46 -0
  298. data/lib/adwords_api/v201409/mutate_job_service.rb +42 -0
  299. data/lib/adwords_api/v201409/mutate_job_service_registry.rb +46 -0
  300. data/lib/adwords_api/v201409/offline_conversion_feed_service.rb +34 -0
  301. data/lib/adwords_api/v201409/offline_conversion_feed_service_registry.rb +46 -0
  302. data/lib/adwords_api/v201409/report_definition_service.rb +34 -0
  303. data/lib/adwords_api/v201409/report_definition_service_registry.rb +46 -0
  304. data/lib/adwords_api/v201409/shared_criterion_service.rb +38 -0
  305. data/lib/adwords_api/v201409/shared_criterion_service_registry.rb +47 -0
  306. data/lib/adwords_api/v201409/shared_set_service.rb +38 -0
  307. data/lib/adwords_api/v201409/shared_set_service_registry.rb +47 -0
  308. data/lib/adwords_api/v201409/targeting_idea_service.rb +34 -0
  309. data/lib/adwords_api/v201409/targeting_idea_service_registry.rb +46 -0
  310. data/lib/adwords_api/v201409/traffic_estimator_service.rb +34 -0
  311. data/lib/adwords_api/v201409/traffic_estimator_service_registry.rb +46 -0
  312. data/lib/adwords_api/version.rb +1 -1
  313. data/test/templates/v201402/basic_operations_get_campaigns.def +0 -0
  314. data/test/templates/v201402/misc_use_oauth2_jwt.def +0 -0
  315. data/test/templates/v201406/basic_operations_get_campaigns.def +0 -0
  316. data/test/templates/v201406/misc_use_oauth2_jwt.def +0 -0
  317. data/test/templates/v201409/basic_operations_get_campaigns.def +114 -0
  318. data/test/templates/v201409/misc_use_oauth2_jwt.def +131 -0
  319. metadata +307 -167
@@ -0,0 +1,171 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.dklimkin@gmail.com (Danial Klimkin)
5
+ #
6
+ # Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example gets and downloads an Ad Hoc report from a XML report definition
22
+ # for all accounts in hierarchy in multiple parallel threads.
23
+ #
24
+ # Note: This code example uses MCC-level calls and won't work with Test
25
+ # Accounts, see: https://developers.google.com/adwords/api/docs/test-accounts
26
+
27
+ require 'thread'
28
+
29
+ require 'adwords_api'
30
+ require 'adwords_api/utils'
31
+
32
+ def parallel_report_download()
33
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
34
+ # when called without parameters.
35
+ adwords = AdwordsApi::Api.new
36
+
37
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
38
+ # the configuration file or provide your own logger:
39
+ # adwords.logger = Logger.new('adwords_xml.log')
40
+
41
+ # Determine list of customer IDs to retrieve report for. For this example we
42
+ # will use ManagedCustomerService to get all IDs in hierarchy.
43
+
44
+ managed_customer_srv = adwords.service(:ManagedCustomerService, API_VERSION)
45
+
46
+ # Get the account hierarchy for this account.
47
+ selector = {:fields => ['CustomerId']}
48
+
49
+ # Run the request at the MCC level.
50
+ graph = adwords.use_mcc() {managed_customer_srv.get(selector)}
51
+
52
+ # Using queue to balance load between threads.
53
+ queue = Queue.new()
54
+
55
+ if graph and graph[:entries] and !graph[:entries].empty?
56
+ graph[:entries].each {|account| queue << account[:customer_id]}
57
+ else
58
+ raise StandardError, 'Can not retrieve any customer ID'
59
+ end
60
+
61
+ # Get report utilities for the version.
62
+ report_utils = adwords.report_utils(API_VERSION)
63
+
64
+ # Define report definition. You can also pass your own XML text as a string.
65
+ report_definition = {
66
+ :selector => {
67
+ :fields => ['CampaignId', 'Id', 'Impressions', 'Clicks', 'Cost'],
68
+ # Predicates are optional.
69
+ :predicates => {
70
+ :field => 'Status',
71
+ :operator => 'IN',
72
+ :values => ['ENABLED', 'PAUSED']
73
+ }
74
+ },
75
+ :report_name => 'Custom ADGROUP_PERFORMANCE_REPORT',
76
+ :report_type => 'ADGROUP_PERFORMANCE_REPORT',
77
+ :download_format => 'CSV',
78
+ :date_range_type => 'LAST_7_DAYS',
79
+ # Enable to get rows with zero impressions.
80
+ :include_zero_impressions => false
81
+ }
82
+
83
+ puts 'Retrieving %d reports with %d threads:' % [queue.size, THREADS]
84
+
85
+ reports_succeeded = Queue.new()
86
+ reports_failed = Queue.new()
87
+
88
+ # Creating a mutex to control access to the queue.
89
+ queue_mutex = Mutex.new
90
+
91
+ # Start all the threads.
92
+ threads = (1..THREADS).map do |thread_id|
93
+ Thread.new(report_definition) do |local_def|
94
+ cid = nil
95
+ begin
96
+ cid = queue_mutex.synchronize {(queue.empty?) ? nil : queue.pop(true)}
97
+ if cid
98
+ retry_count = 0
99
+ file_name = 'adgroup_%010d.csv' % cid
100
+ puts "[%2d/%d] Loading report for customer ID %s into '%s'..." %
101
+ [thread_id, retry_count,
102
+ AdwordsApi::Utils.format_id(cid), file_name]
103
+ begin
104
+ report_utils.download_report_as_file(local_def, file_name, cid)
105
+ reports_succeeded << {:cid => cid, :file_name => file_name}
106
+ rescue AdwordsApi::Errors::ReportError => e
107
+ if e.http_code == 500 && retry_count < MAX_RETRIES
108
+ retry_count += 1
109
+ sleep(retry_count * BACKOFF_FACTOR)
110
+ retry
111
+ else
112
+ puts(('Report failed for customer ID %s with code %d after %d ' +
113
+ 'retries.') % [cid, e.http_code, retry_count + 1])
114
+ reports_failed <<
115
+ {:cid => cid, :http_code => e.http_code, :message => e.message}
116
+ end
117
+ end
118
+ end
119
+ end while (cid != nil)
120
+ end
121
+ end
122
+
123
+ # Wait for all threads to finish.
124
+ threads.each { |aThread| aThread.join }
125
+
126
+ puts 'Download completed, results:'
127
+ puts 'Successful reports:'
128
+ while !reports_succeeded.empty? do
129
+ result = reports_succeeded.pop()
130
+ puts "\tClient ID %s => '%s'" %
131
+ [AdwordsApi::Utils.format_id(result[:cid]), result[:file_name]]
132
+ end
133
+ puts 'Failed reports:'
134
+ while !reports_failed.empty? do
135
+ result = reports_failed.pop()
136
+ puts "\tClient ID %s => Code: %d, Message: '%s'" %
137
+ [AdwordsApi::Utils.format_id(result[:cid]),
138
+ result[:http_code], result[:message]]
139
+ end
140
+ puts 'End of results.'
141
+ end
142
+
143
+ if __FILE__ == $0
144
+ API_VERSION = :v201409
145
+ # Number of parallel threads to spawn.
146
+ THREADS = 10
147
+ # Maximum number of retries for 500 errors.
148
+ MAX_RETRIES = 5
149
+ # Timeout between retries in seconds.
150
+ BACKOFF_FACTOR = 5
151
+
152
+ begin
153
+ parallel_report_download()
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
+
163
+ # HTTP errors.
164
+ rescue AdsCommon::Errors::HttpError => e
165
+ puts 'HTTP Error: %s' % e
166
+
167
+ # API errors.
168
+ rescue AdwordsApi::Errors::ReportError => e
169
+ puts 'Reporting Error: %s' % e.message
170
+ end
171
+ end
@@ -0,0 +1,269 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.mcloonan@gmail.com (Michael Cloonan)
5
+ #
6
+ # Copyright:: Copyright 2014, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example creates a ProductPartition tree.
22
+
23
+ require 'adwords_api'
24
+
25
+ class ProductPartitionHelper
26
+ attr_reader :operations
27
+
28
+ def initialize(ad_group_id)
29
+ # The next temporary criterion ID to be used.
30
+ #
31
+ # When creating our tree we need to specify the parent-child relationships
32
+ # between nodes. However, until a criterion has been created on the server
33
+ # we do not have a criterionId with which to refer to it.
34
+ #
35
+ # Instead we can specify temporary IDs that are specific to a single mutate
36
+ # request. Once the criteria have been created they are assigned an ID as
37
+ # normal and the temporary ID will no longer refer to it.
38
+ #
39
+ # A valid temporary ID is any negative integer.
40
+ @next_id = -1
41
+
42
+ # The set of mutate operations needed to create the current tree.
43
+ @operations = []
44
+
45
+ # The ID of the AdGroup that we wish to attach the partition tree to.
46
+ @ad_group_id = ad_group_id
47
+ end
48
+
49
+ def create_subdivision(parent = nil, value = nil)
50
+ division = {
51
+ :xsi_type => 'ProductPartition',
52
+ :partition_type => 'SUBDIVISION',
53
+ :id => @next_id
54
+ }
55
+
56
+ @next_id -= 1
57
+
58
+ unless parent.nil? || value.nil?
59
+ division[:parent_criterion_id] = parent[:id]
60
+ division[:case_value] = value
61
+ end
62
+
63
+ ad_group_criterion = {
64
+ :xsi_type => 'BiddableAdGroupCriterion',
65
+ :ad_group_id => @ad_group_id,
66
+ :criterion => division
67
+ }
68
+
69
+ create_add_operation(ad_group_criterion)
70
+
71
+ return division
72
+ end
73
+
74
+ def create_unit(parent = nil, value = nil, bid_amount = nil)
75
+ unit = {
76
+ :xsi_type => 'ProductPartition',
77
+ :partition_type => 'UNIT'
78
+ }
79
+
80
+ unless parent.nil? || value.nil?
81
+ unit[:parent_criterion_id] = parent[:id]
82
+ unit[:case_value] = value
83
+ end
84
+
85
+ ad_group_criterion = {}
86
+ if bid_amount && bid_amount > 0
87
+ bidding_strategy_configuration = {
88
+ :bids => [{
89
+ :xsi_type => 'CpcBid',
90
+ :bid => {
91
+ :xsi_type => 'Money',
92
+ :micro_amount => bid_amount
93
+ }
94
+ }]
95
+ }
96
+ ad_group_criterion[:xsi_type] = 'BiddableAdGroupCriterion'
97
+ ad_group_criterion[:bidding_strategy_configuration] =
98
+ bidding_strategy_configuration
99
+ else
100
+ ad_group_criterion[:xsi_type] = 'NegativeAdGroupCriterion'
101
+ end
102
+ ad_group_criterion[:ad_group_id] = @ad_group_id
103
+ ad_group_criterion[:criterion] = unit
104
+
105
+ create_add_operation(ad_group_criterion)
106
+
107
+ return unit
108
+ end
109
+
110
+ private
111
+
112
+ def create_add_operation(ad_group_criterion)
113
+ operation = {
114
+ :operator => 'ADD',
115
+ :operand => ad_group_criterion
116
+ }
117
+
118
+ @operations << operation
119
+ end
120
+ end
121
+
122
+ def display_tree(node, children, level = 0)
123
+ value = ''
124
+ type = ''
125
+
126
+ if node[:case_value]
127
+ type = node[:case_value][:product_dimension_type]
128
+
129
+ value = case type
130
+ when 'ProductCanonicalCondition'
131
+ node[:case_value][:condition]
132
+ when 'ProductBiddingCategory'
133
+ "%s(%s)" % [node[:case_value][:type], node[:case_value][:value]]
134
+ else
135
+ node[:case_value][:value]
136
+ end
137
+ end
138
+
139
+ puts "%sid: %s, type: %s, value: %s" %
140
+ [' ' * level, node[:id], type, value]
141
+
142
+ children[node[:id]].each do |child_node|
143
+ display_tree(child_node, children, level + 1)
144
+ end
145
+ end
146
+
147
+ def add_product_partition_tree(ad_group_id)
148
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
149
+ # when called without parameters.
150
+ adwords = AdwordsApi::Api.new
151
+
152
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
153
+ # the configuration file or provide your own logger:
154
+ # adwords.logger = Logger.new('adwords_xml.log')
155
+
156
+ ad_group_criterion_srv =
157
+ adwords.service(:AdGroupCriterionService, API_VERSION)
158
+
159
+ helper = ProductPartitionHelper.new(ad_group_id)
160
+
161
+ root = helper.create_subdivision()
162
+
163
+ new_product_canonical_condition = {
164
+ :xsi_type => 'ProductCanonicalCondition',
165
+ :condition => 'NEW'
166
+ }
167
+
168
+ used_product_canonical_condition = {
169
+ :xsi_type => 'ProductCanonicalCondition',
170
+ :condition => 'USED'
171
+ }
172
+
173
+ other_product_canonical_condition = {
174
+ :xsi_type => 'ProductCanonicalCondition'
175
+ }
176
+
177
+ helper.create_unit(root, new_product_canonical_condition, 200000)
178
+ helper.create_unit(root, used_product_canonical_condition, 100000)
179
+ other_condition =
180
+ helper.create_subdivision(root, other_product_canonical_condition)
181
+
182
+ cool_product_brand = {
183
+ :xsi_type => 'ProductBrand',
184
+ :value => 'CoolBrand'
185
+ }
186
+
187
+ cheap_product_brand = {
188
+ :xsi_type => 'ProductBrand',
189
+ :value => 'CheapBrand'
190
+ }
191
+
192
+ other_product_brand = {
193
+ :xsi_type => 'ProductBrand'
194
+ }
195
+
196
+ helper.create_unit(other_condition, cool_product_brand, 900000)
197
+ helper.create_unit(other_condition, cheap_product_brand, 10000)
198
+ other_brand = helper.create_subdivision(other_condition, other_product_brand)
199
+
200
+ # The value for the bidding category is a fixed ID for the 'Luggage & Bags'
201
+ # category. You can retrieve IDs for categories from the ConstantDataService.
202
+ # See the get_product_taxonomy example for more details.
203
+ luggage_category = {
204
+ :xsi_type => 'ProductBiddingCategory',
205
+ :type => 'BIDDING_CATEGORY_L1',
206
+ :value => '-5914235892932915235'
207
+ }
208
+
209
+ generic_category = {
210
+ :xsi_type => 'ProductBiddingCategory',
211
+ :type => 'BIDDING_CATEGORY_L1'
212
+ }
213
+
214
+ helper.create_unit(other_brand, luggage_category, 750000)
215
+ helper.create_unit(other_brand, generic_category, 110000)
216
+
217
+ # Make the mutate request.
218
+ result = ad_group_criterion_srv.mutate(helper.operations)
219
+
220
+ children = {}
221
+ root_node = nil
222
+ # For each criterion, make an array containing each of its children.
223
+ # We always create the parent before the child, so we can rely on that here.
224
+ result[:value].each do |criterion|
225
+ children[criterion[:criterion][:id]] = []
226
+
227
+ if criterion[:criterion][:parent_criterion_id]
228
+ children[criterion[:criterion][:parent_criterion_id]] <<
229
+ criterion[:criterion]
230
+ else
231
+ root_node = criterion[:criterion]
232
+ end
233
+ end
234
+
235
+ display_tree(root_node, children)
236
+ end
237
+
238
+ if __FILE__ == $0
239
+ API_VERSION = :v201409
240
+
241
+ begin
242
+ ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i
243
+
244
+ add_product_partition_tree(ad_group_id)
245
+
246
+ # Authorization error.
247
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
248
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
249
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
250
+ "to retrieve and store OAuth2 tokens."
251
+ puts "See this wiki page for more details:\n\n " +
252
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
253
+
254
+ # HTTP errors.
255
+ rescue AdsCommon::Errors::HttpError => e
256
+ puts "HTTP Error: %s" % e
257
+
258
+ # API errors.
259
+ rescue AdwordsApi::Errors::ApiException => e
260
+ puts "Message: %s" % e.message
261
+ puts 'Errors:'
262
+ e.errors.each_with_index do |error, index|
263
+ puts "\tError [%d]:" % (index + 1)
264
+ error.each do |field, value|
265
+ puts "\t\t%s: %s" % [field, value]
266
+ end
267
+ end
268
+ end
269
+ end
@@ -0,0 +1,133 @@
1
+ #!/usr/bin/env ruby
2
+ # Encoding: utf-8
3
+ #
4
+ # Author:: api.mcloonan@gmail.com (Michael Cloonan)
5
+ #
6
+ # Copyright:: Copyright 2014, Google Inc. All Rights Reserved.
7
+ #
8
+ # License:: Licensed under the Apache License, Version 2.0 (the "License");
9
+ # you may not use this file except in compliance with the License.
10
+ # You may obtain a copy of the License at
11
+ #
12
+ # http://www.apache.org/licenses/LICENSE-2.0
13
+ #
14
+ # Unless required by applicable law or agreed to in writing, software
15
+ # distributed under the License is distributed on an "AS IS" BASIS,
16
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17
+ # implied.
18
+ # See the License for the specific language governing permissions and
19
+ # limitations under the License.
20
+ #
21
+ # This example restricts the products that will be included in the campaign by
22
+ # setting a ProductScope.
23
+ #
24
+ # Tags: CampaignCriterionService.mutate
25
+
26
+ require 'adwords_api'
27
+
28
+ def add_product_scope(campaign_id)
29
+ # AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
30
+ # when called without parameters.
31
+ adwords = AdwordsApi::Api.new
32
+
33
+ # To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
34
+ # the configuration file or provide your own logger:
35
+ # adwords.logger = Logger.new('adwords_xml.log')
36
+
37
+ campaign_criterion_srv = adwords.service(:CampaignCriterionService,
38
+ API_VERSION)
39
+
40
+ product_scope = {
41
+ # This set of dimensions is for demonstration purposes only. It is
42
+ # extremely unlikely that you want to include so many dimensions in your
43
+ # product scope.
44
+ :dimensions => [
45
+ {
46
+ :xsi_type => 'ProductBrand',
47
+ :value => 'Nexus'
48
+ },
49
+ {
50
+ :xsi_type => 'ProductCanonicalCondition',
51
+ :value => 'NEW'
52
+ },
53
+ {
54
+ :xsi_type => 'ProductCustomAttribute',
55
+ :type => 'CUSTOM_ATTRIBUTE_0',
56
+ :value => 'my attribute value'
57
+ },
58
+ {
59
+ :xsi_type => 'ProductOfferId',
60
+ :value => 'book1'
61
+ },
62
+ {
63
+ :xsi_type => 'ProductType',
64
+ :type => 'PRODUCT_TYPE_L1',
65
+ :value => 'Media'
66
+ },
67
+ {
68
+ :xsi_type => 'ProductType',
69
+ :type => 'PRODUCT_TYPE_L2',
70
+ :value => 'Books'
71
+ },
72
+ # The value for the bidding category is a fixed ID for the
73
+ # 'Luggage & Bags' category. You can retrieve IDs for categories from
74
+ # the ConstantDataService. See the 'get_product_category_taxonomy'
75
+ # example for more details.
76
+ {
77
+ :xsi_type => 'ProductBiddingCategory',
78
+ :type => 'BIDDING_CATEGORY_L1',
79
+ :value => '-5914235892932915235',
80
+ }
81
+ ]
82
+ }
83
+
84
+ campaign_criterion = {
85
+ :campaign_id => campaign_id,
86
+ :product_scope => product_scope
87
+ }
88
+
89
+ campaign_criterion_operation = {
90
+ :operator => 'ADD',
91
+ :operand => campaign_criterion
92
+ }
93
+
94
+ # Make the mutate request.
95
+ result = campaign_criterion_srv.mutate([campaign_criterion_operation])
96
+
97
+ campaign_criterion = result[:value].first
98
+ puts "Created a ProductScope criterion with ID %d." %
99
+ [campaign_criterion[:criterion][:id]]
100
+ end
101
+
102
+ if __FILE__ == $0
103
+ API_VERSION = :v201409
104
+
105
+ begin
106
+ campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
107
+
108
+ add_product_scope(campaign_id)
109
+
110
+ # Authorization error.
111
+ rescue AdsCommon::Errors::OAuth2VerificationRequired => e
112
+ puts "Authorization credentials are not valid. Edit adwords_api.yml for " +
113
+ "OAuth2 client ID and secret and run misc/setup_oauth2.rb example " +
114
+ "to retrieve and store OAuth2 tokens."
115
+ puts "See this wiki page for more details:\n\n " +
116
+ 'http://code.google.com/p/google-api-ads-ruby/wiki/OAuth2'
117
+
118
+ # HTTP errors.
119
+ rescue AdsCommon::Errors::HttpError => e
120
+ puts "HTTP Error: %s" % e
121
+
122
+ # API errors.
123
+ rescue AdwordsApi::Errors::ApiException => e
124
+ puts "Message: %s" % e.message
125
+ puts 'Errors:'
126
+ e.errors.each_with_index do |error, index|
127
+ puts "\tError [%d]:" % (index + 1)
128
+ error.each do |field, value|
129
+ puts "\t\t%s: %s" % [field, value]
130
+ end
131
+ end
132
+ end
133
+ end