google-adwords-api 0.4.5 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +4 -0
- data/README +3 -3
- data/Rakefile +3 -3
- data/examples/v201109/{create_account.rb → account_management/create_account.rb} +2 -1
- data/examples/v201109/{get_campaign_alerts.rb → account_management/get_account_alerts.rb} +38 -21
- data/examples/v201109/{get_all_account_changes.rb → account_management/get_account_changes.rb} +40 -39
- data/examples/v201109/{get_account_hierarchy.rb → account_management/get_account_hierarchy.rb} +2 -1
- data/examples/v201109/{get_client_customer_id.rb → account_management/get_client_customer_id.rb} +2 -1
- data/examples/v201109/{get_unit_count.rb → account_management/get_client_unit_usage.rb} +15 -7
- data/examples/v201109/{add_ad_group.rb → basic_operations/add_ad_group.rb} +2 -1
- data/examples/v201109/{add_campaign.rb → basic_operations/add_campaign.rb} +2 -1
- data/examples/v201109/{add_ad_group_criteria.rb → basic_operations/add_keywords.rb} +32 -37
- data/examples/{v200909/update_ad.rb → v201109/basic_operations/add_text_ads.rb} +41 -25
- data/examples/v201109/{delete_ad.rb → basic_operations/delete_ad.rb} +5 -4
- data/examples/v201109/{delete_ad_group.rb → basic_operations/delete_ad_group.rb} +34 -8
- data/examples/v201109/{delete_campaign.rb → basic_operations/delete_campaign.rb} +32 -6
- data/examples/v201109/{delete_ad_group_criterion.rb → basic_operations/delete_keyword.rb} +15 -10
- data/examples/v201109/{get_all_ad_groups.rb → basic_operations/get_ad_groups.rb} +32 -18
- data/examples/v201109/{get_all_campaigns.rb → basic_operations/get_campaigns.rb} +31 -14
- data/examples/v201109/{get_all_active_ad_group_criteria.rb → basic_operations/get_keywords.rb} +41 -34
- data/examples/v201109/{get_all_ads.rb → basic_operations/get_text_ads.rb} +39 -22
- data/examples/v201109/{update_ad.rb → basic_operations/pause_ad.rb} +9 -10
- data/examples/v201109/{update_ad_group.rb → basic_operations/update_ad_group.rb} +2 -1
- data/examples/v201109/{update_campaign.rb → basic_operations/update_campaign.rb} +2 -1
- data/examples/v201109/{update_ad_group_criterion.rb → basic_operations/update_keyword.rb} +10 -9
- data/examples/v201109/{add_experiment.rb → campaign_management/add_experiment.rb} +4 -3
- data/examples/v201109/{perform_mutate_job.rb → campaign_management/add_keywords_in_bulk.rb} +17 -43
- data/examples/v201109/{add_campaign_ad_extension.rb → campaign_management/add_location_extension.rb} +28 -37
- data/examples/v201109/{add_ad_extension_override.rb → campaign_management/add_location_extension_override.rb} +12 -10
- data/examples/v201109/{get_all_disapproved_ads.rb → campaign_management/get_all_disapproved_ads.rb} +3 -2
- data/examples/v201109/{promote_experiment.rb → campaign_management/promote_experiment.rb} +4 -4
- data/examples/v201109/{set_ad_params.rb → campaign_management/set_ad_parameters.rb} +7 -7
- data/examples/{v201003/delete_ad.rb → v201109/campaign_management/validate_text_ad.rb} +40 -16
- data/examples/v201109/{handle_partial_failures.rb → error_handling/handle_partial_failures.rb} +2 -1
- data/examples/v201109/{handle_policy_violation_error.rb → error_handling/handle_policy_violation_error.rb} +2 -1
- data/examples/v201109/{handle_second_factor.rb → error_handling/handle_two_factor_authorization_error.rb} +5 -4
- data/examples/v201109/{get_all_images.rb → misc/get_all_images_and_videos.rb} +40 -20
- data/examples/v201109/{upload_image.rb → misc/upload_image.rb} +2 -1
- data/examples/v201109/{oauth_handling.rb → misc/use_oauth.rb} +10 -7
- data/examples/v201109/{get_traffic_estimates.rb → optimization/estimate_keyword_traffic.rb} +4 -3
- data/examples/v201109/{get_criterion_bid_landscape.rb → optimization/get_keyword_bid_simulations.rb} +21 -20
- data/examples/v201109/{get_related_keywords.rb → optimization/get_keyword_ideas.rb} +6 -5
- data/examples/v201109/{get_keyword_opportunities.rb → optimization/get_keyword_opportunities.rb} +2 -1
- data/examples/v201109/{get_related_placements.rb → optimization/get_placement_ideas.rb} +5 -4
- data/examples/v201109/{add_user_list.rb → remarketing/add_audience.rb} +6 -5
- data/examples/v201109/{add_conversion.rb → remarketing/add_conversion_tracker.rb} +8 -7
- data/examples/v201109/{download_adhoc_report.rb → reporting/download_criteria_report.rb} +19 -17
- data/examples/v201109/{download_report.rb → reporting/download_defined_report.rb} +7 -5
- data/examples/v201109/{get_all_report_definitions.rb → reporting/get_defined_reports.rb} +7 -6
- data/examples/v201109/{get_report_fields.rb → reporting/get_report_fields.rb} +2 -1
- data/examples/v201109/{parallel_report_download.rb → reporting/parallel_report_download.rb} +2 -1
- data/examples/v201109/{add_campaign_targeting_criteria.rb → targeting/add_campaign_targeting_criteria.rb} +22 -4
- data/examples/v201109/{add_negative_campaign_criterion.rb → targeting/get_campaign_targeting_criteria.rb} +43 -26
- data/examples/v201109/{get_all_carriers.rb → targeting/get_targetable_languages_and_carriers.rb} +19 -4
- data/examples/v201109/{get_location_criteria.rb → targeting/lookup_location.rb} +4 -3
- data/lib/adwords_api.rb +2 -2
- data/lib/adwords_api/api_config.rb +3 -130
- data/lib/adwords_api/client_login_header_handler.rb +1 -1
- data/lib/adwords_api/credential_handler.rb +2 -2
- data/lib/adwords_api/errors.rb +2 -2
- data/lib/adwords_api/extensions.rb +3 -2
- data/lib/adwords_api/report_utils.rb +1 -1
- data/lib/adwords_api/utils.rb +2 -2
- data/lib/adwords_api/v13_login_handler.rb +1 -1
- data/lib/adwords_api/v201109/ad_extension_override_service.rb +10 -8
- data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/ad_group_ad_service.rb +10 -8
- data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/ad_group_criterion_service.rb +10 -8
- data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/ad_group_service.rb +10 -8
- data/lib/adwords_api/v201109/ad_group_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/ad_param_service.rb +10 -8
- data/lib/adwords_api/v201109/ad_param_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/alert_service.rb +6 -4
- data/lib/adwords_api/v201109/alert_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +10 -8
- data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/bulk_opportunity_service.rb +6 -4
- data/lib/adwords_api/v201109/bulk_opportunity_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +10 -8
- data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/campaign_criterion_service.rb +10 -8
- data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/campaign_service.rb +10 -8
- data/lib/adwords_api/v201109/campaign_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/campaign_target_service.rb +10 -8
- data/lib/adwords_api/v201109/campaign_target_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/constant_data_service.rb +6 -4
- data/lib/adwords_api/v201109/constant_data_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/conversion_tracker_service.rb +10 -8
- data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/create_account_service.rb +6 -4
- data/lib/adwords_api/v201109/create_account_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/customer_sync_service.rb +6 -4
- data/lib/adwords_api/v201109/customer_sync_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/data_service.rb +10 -8
- data/lib/adwords_api/v201109/data_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/experiment_service.rb +10 -8
- data/lib/adwords_api/v201109/experiment_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/geo_location_service.rb +6 -4
- data/lib/adwords_api/v201109/geo_location_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/info_service.rb +6 -4
- data/lib/adwords_api/v201109/info_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/location_criterion_service.rb +6 -4
- data/lib/adwords_api/v201109/location_criterion_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/media_service.rb +10 -8
- data/lib/adwords_api/v201109/media_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/mutate_job_service.rb +10 -8
- data/lib/adwords_api/v201109/mutate_job_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/report_definition_service.rb +10 -8
- data/lib/adwords_api/v201109/report_definition_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/serviced_account_service.rb +6 -4
- data/lib/adwords_api/v201109/serviced_account_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/targeting_idea_service.rb +10 -8
- data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/traffic_estimator_service.rb +6 -4
- data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +8 -6
- data/lib/adwords_api/v201109/user_list_service.rb +10 -8
- data/lib/adwords_api/v201109/user_list_service_registry.rb +8 -6
- data/test/adwords_api/test_api_config.rb +2 -7
- data/test/adwords_api/test_report_utils.rb +2 -1
- data/test/adwords_api/test_utils.rb +1 -0
- data/test/bugs/test_issue_00000031.rb +2 -1
- metadata +116 -481
- data/examples/v200909/add_ad_extension_override.rb +0 -82
- data/examples/v200909/add_ad_group.rb +0 -89
- data/examples/v200909/add_ad_group_criteria.rb +0 -108
- data/examples/v200909/add_ads.rb +0 -121
- data/examples/v200909/add_campaign.rb +0 -92
- data/examples/v200909/add_campaign_ad_extension.rb +0 -121
- data/examples/v200909/add_negative_campaign_criterion.rb +0 -87
- data/examples/v200909/check_campaigns.rb +0 -123
- data/examples/v200909/delete_ad.rb +0 -85
- data/examples/v200909/delete_ad_group.rb +0 -77
- data/examples/v200909/delete_ad_group_criterion.rb +0 -86
- data/examples/v200909/delete_campaign.rb +0 -78
- data/examples/v200909/get_all_active_ad_group_criteria.rb +0 -84
- data/examples/v200909/get_all_ad_extension_overrides.rb +0 -82
- data/examples/v200909/get_all_ad_group_criteria.rb +0 -82
- data/examples/v200909/get_all_ad_groups.rb +0 -79
- data/examples/v200909/get_all_ad_params.rb +0 -80
- data/examples/v200909/get_all_ads.rb +0 -79
- data/examples/v200909/get_all_campaign_ad_extensions.rb +0 -81
- data/examples/v200909/get_all_campaign_targets.rb +0 -74
- data/examples/v200909/get_all_campaigns.rb +0 -74
- data/examples/v200909/get_all_disapproved_ads.rb +0 -85
- data/examples/v200909/get_all_paused_campaigns.rb +0 -77
- data/examples/v200909/get_conversion_optimizer_eligibility.rb +0 -103
- data/examples/v200909/get_geo_location_info.rb +0 -99
- data/examples/v200909/get_method_cost.rb +0 -87
- data/examples/v200909/get_operation_count.rb +0 -79
- data/examples/v200909/get_related_keywords.rb +0 -108
- data/examples/v200909/get_related_placements.rb +0 -107
- data/examples/v200909/get_total_usage_units_per_month.rb +0 -74
- data/examples/v200909/get_unit_count.rb +0 -79
- data/examples/v200909/perform_bulk_mutate_job.rb +0 -212
- data/examples/v200909/set_ad_params.rb +0 -115
- data/examples/v200909/set_campaign_targets.rb +0 -116
- data/examples/v200909/update_ad_group.rb +0 -81
- data/examples/v200909/update_ad_group_criterion.rb +0 -99
- data/examples/v200909/update_campaign.rb +0 -84
- data/examples/v201003/add_ad_extension_override.rb +0 -82
- data/examples/v201003/add_ad_group.rb +0 -89
- data/examples/v201003/add_ad_group_criteria.rb +0 -108
- data/examples/v201003/add_ads.rb +0 -174
- data/examples/v201003/add_campaign.rb +0 -92
- data/examples/v201003/add_campaign_ad_extension.rb +0 -121
- data/examples/v201003/add_keywords_performance_report_definition.rb +0 -99
- data/examples/v201003/add_negative_campaign_criterion.rb +0 -87
- data/examples/v201003/check_campaigns.rb +0 -123
- data/examples/v201003/delete_ad_group.rb +0 -77
- data/examples/v201003/delete_ad_group_criterion.rb +0 -86
- data/examples/v201003/delete_campaign.rb +0 -78
- data/examples/v201003/download_report.rb +0 -67
- data/examples/v201003/get_all_active_ad_group_criteria.rb +0 -84
- data/examples/v201003/get_all_ad_extension_overrides.rb +0 -82
- data/examples/v201003/get_all_ad_group_criteria.rb +0 -82
- data/examples/v201003/get_all_ad_groups.rb +0 -79
- data/examples/v201003/get_all_ad_params.rb +0 -80
- data/examples/v201003/get_all_ads.rb +0 -82
- data/examples/v201003/get_all_campaign_ad_extensions.rb +0 -81
- data/examples/v201003/get_all_campaign_targets.rb +0 -74
- data/examples/v201003/get_all_campaigns.rb +0 -74
- data/examples/v201003/get_all_disapproved_ads.rb +0 -85
- data/examples/v201003/get_all_images.rb +0 -80
- data/examples/v201003/get_all_paused_campaigns.rb +0 -77
- data/examples/v201003/get_all_report_definitions.rb +0 -75
- data/examples/v201003/get_all_videos.rb +0 -76
- data/examples/v201003/get_conversion_optimizer_eligibility.rb +0 -103
- data/examples/v201003/get_criterion_bid_landscape.rb +0 -96
- data/examples/v201003/get_geo_location_info.rb +0 -99
- data/examples/v201003/get_method_cost.rb +0 -87
- data/examples/v201003/get_operation_count.rb +0 -79
- data/examples/v201003/get_related_keywords.rb +0 -108
- data/examples/v201003/get_related_placements.rb +0 -107
- data/examples/v201003/get_report_fields.rb +0 -72
- data/examples/v201003/get_total_usage_units_per_month.rb +0 -74
- data/examples/v201003/get_unit_count.rb +0 -79
- data/examples/v201003/perform_bulk_mutate_job.rb +0 -212
- data/examples/v201003/set_ad_params.rb +0 -115
- data/examples/v201003/set_campaign_targets.rb +0 -116
- data/examples/v201003/update_ad.rb +0 -86
- data/examples/v201003/update_ad_group.rb +0 -81
- data/examples/v201003/update_ad_group_criterion.rb +0 -99
- data/examples/v201003/update_campaign.rb +0 -83
- data/examples/v201003/upload_image.rb +0 -90
- data/examples/v201008/add_ad_extension_override.rb +0 -82
- data/examples/v201008/add_ad_group.rb +0 -89
- data/examples/v201008/add_ad_group_criteria.rb +0 -108
- data/examples/v201008/add_ads.rb +0 -174
- data/examples/v201008/add_campaign.rb +0 -92
- data/examples/v201008/add_campaign_ad_extension.rb +0 -121
- data/examples/v201008/add_experiment.rb +0 -153
- data/examples/v201008/add_keywords_performance_report_definition.rb +0 -99
- data/examples/v201008/add_negative_campaign_criterion.rb +0 -87
- data/examples/v201008/add_user_list.rb +0 -87
- data/examples/v201008/check_campaigns.rb +0 -123
- data/examples/v201008/delete_ad.rb +0 -85
- data/examples/v201008/delete_ad_group.rb +0 -77
- data/examples/v201008/delete_ad_group_criterion.rb +0 -86
- data/examples/v201008/delete_bulk_mutate_job.rb +0 -87
- data/examples/v201008/delete_campaign.rb +0 -78
- data/examples/v201008/delete_experiment.rb +0 -78
- data/examples/v201008/delete_user_list.rb +0 -78
- data/examples/v201008/download_report.rb +0 -67
- data/examples/v201008/get_account_hierarchy.rb +0 -101
- data/examples/v201008/get_all_account_changes.rb +0 -135
- data/examples/v201008/get_all_active_ad_group_criteria.rb +0 -84
- data/examples/v201008/get_all_ad_extension_overrides.rb +0 -82
- data/examples/v201008/get_all_ad_group_criteria.rb +0 -82
- data/examples/v201008/get_all_ad_groups.rb +0 -79
- data/examples/v201008/get_all_ad_params.rb +0 -80
- data/examples/v201008/get_all_ads.rb +0 -82
- data/examples/v201008/get_all_campaign_ad_extensions.rb +0 -81
- data/examples/v201008/get_all_campaign_targets.rb +0 -74
- data/examples/v201008/get_all_campaigns.rb +0 -74
- data/examples/v201008/get_all_disapproved_ads.rb +0 -85
- data/examples/v201008/get_all_experiments.rb +0 -84
- data/examples/v201008/get_all_images.rb +0 -80
- data/examples/v201008/get_all_paused_campaigns.rb +0 -77
- data/examples/v201008/get_all_report_definitions.rb +0 -75
- data/examples/v201008/get_all_user_lists.rb +0 -75
- data/examples/v201008/get_all_videos.rb +0 -76
- data/examples/v201008/get_bulk_mutate_job.rb +0 -97
- data/examples/v201008/get_campaign_alerts.rb +0 -95
- data/examples/v201008/get_conversion_optimizer_eligibility.rb +0 -88
- data/examples/v201008/get_criterion_bid_landscape.rb +0 -96
- data/examples/v201008/get_geo_location_info.rb +0 -99
- data/examples/v201008/get_method_cost.rb +0 -87
- data/examples/v201008/get_operation_count.rb +0 -79
- data/examples/v201008/get_related_keywords.rb +0 -108
- data/examples/v201008/get_related_placements.rb +0 -107
- data/examples/v201008/get_report_fields.rb +0 -72
- data/examples/v201008/get_total_usage_units_per_month.rb +0 -74
- data/examples/v201008/get_traffic_estimates.rb +0 -147
- data/examples/v201008/get_unit_count.rb +0 -79
- data/examples/v201008/handle_partial_failures.rb +0 -127
- data/examples/v201008/handle_policy_violation_error.rb +0 -138
- data/examples/v201008/perform_bulk_mutate_job.rb +0 -212
- data/examples/v201008/promote_experiment.rb +0 -79
- data/examples/v201008/set_ad_params.rb +0 -115
- data/examples/v201008/set_campaign_targets.rb +0 -116
- data/examples/v201008/update_ad.rb +0 -86
- data/examples/v201008/update_ad_group.rb +0 -81
- data/examples/v201008/update_ad_group_criterion.rb +0 -99
- data/examples/v201008/update_campaign.rb +0 -84
- data/examples/v201008/update_user_list.rb +0 -82
- data/examples/v201008/upload_image.rb +0 -90
- data/examples/v201101/add_ad_extension_override.rb +0 -82
- data/examples/v201101/add_ad_group.rb +0 -89
- data/examples/v201101/add_ad_group_criteria.rb +0 -108
- data/examples/v201101/add_ads.rb +0 -174
- data/examples/v201101/add_campaign.rb +0 -99
- data/examples/v201101/add_campaign_ad_extension.rb +0 -121
- data/examples/v201101/add_conversion.rb +0 -88
- data/examples/v201101/add_experiment.rb +0 -153
- data/examples/v201101/add_keywords_performance_report_definition.rb +0 -99
- data/examples/v201101/add_negative_campaign_criterion.rb +0 -87
- data/examples/v201101/add_user_list.rb +0 -113
- data/examples/v201101/check_campaigns.rb +0 -123
- data/examples/v201101/delete_ad.rb +0 -85
- data/examples/v201101/delete_ad_group.rb +0 -77
- data/examples/v201101/delete_ad_group_criterion.rb +0 -86
- data/examples/v201101/delete_bulk_mutate_job.rb +0 -87
- data/examples/v201101/delete_campaign.rb +0 -78
- data/examples/v201101/delete_experiment.rb +0 -78
- data/examples/v201101/delete_user_list.rb +0 -78
- data/examples/v201101/download_report.rb +0 -67
- data/examples/v201101/get_account_hierarchy.rb +0 -102
- data/examples/v201101/get_ad_group_bid_landscape.rb +0 -94
- data/examples/v201101/get_all_account_changes.rb +0 -137
- data/examples/v201101/get_all_active_ad_group_criteria.rb +0 -97
- data/examples/v201101/get_all_ad_extension_overrides.rb +0 -82
- data/examples/v201101/get_all_ad_group_criteria.rb +0 -88
- data/examples/v201101/get_all_ad_groups.rb +0 -85
- data/examples/v201101/get_all_ad_params.rb +0 -80
- data/examples/v201101/get_all_ads.rb +0 -90
- data/examples/v201101/get_all_campaign_ad_extensions.rb +0 -87
- data/examples/v201101/get_all_campaign_targets.rb +0 -74
- data/examples/v201101/get_all_campaigns.rb +0 -77
- data/examples/v201101/get_all_conversions.rb +0 -79
- data/examples/v201101/get_all_disapproved_ads.rb +0 -93
- data/examples/v201101/get_all_experiments.rb +0 -89
- data/examples/v201101/get_all_images.rb +0 -82
- data/examples/v201101/get_all_paused_campaigns.rb +0 -83
- data/examples/v201101/get_all_report_definitions.rb +0 -75
- data/examples/v201101/get_all_user_lists.rb +0 -78
- data/examples/v201101/get_all_videos.rb +0 -78
- data/examples/v201101/get_bulk_mutate_job.rb +0 -97
- data/examples/v201101/get_campaign_alerts.rb +0 -95
- data/examples/v201101/get_conversion_optimizer_eligibility.rb +0 -93
- data/examples/v201101/get_criterion_bid_landscape.rb +0 -93
- data/examples/v201101/get_geo_location_info.rb +0 -99
- data/examples/v201101/get_keyword_opportunities.rb +0 -95
- data/examples/v201101/get_method_cost.rb +0 -87
- data/examples/v201101/get_operation_count.rb +0 -79
- data/examples/v201101/get_related_keywords.rb +0 -108
- data/examples/v201101/get_related_placements.rb +0 -107
- data/examples/v201101/get_report_fields.rb +0 -72
- data/examples/v201101/get_total_usage_units_per_month.rb +0 -74
- data/examples/v201101/get_traffic_estimates.rb +0 -148
- data/examples/v201101/get_unit_count.rb +0 -79
- data/examples/v201101/handle_partial_failures.rb +0 -127
- data/examples/v201101/handle_policy_violation_error.rb +0 -138
- data/examples/v201101/handle_second_factor.rb +0 -87
- data/examples/v201101/oauth_handling.rb +0 -95
- data/examples/v201101/perform_bulk_mutate_job.rb +0 -212
- data/examples/v201101/promote_experiment.rb +0 -79
- data/examples/v201101/set_ad_params.rb +0 -115
- data/examples/v201101/set_campaign_targets.rb +0 -102
- data/examples/v201101/update_ad.rb +0 -86
- data/examples/v201101/update_ad_group.rb +0 -81
- data/examples/v201101/update_ad_group_criterion.rb +0 -99
- data/examples/v201101/update_campaign.rb +0 -84
- data/examples/v201101/update_conversion.rb +0 -87
- data/examples/v201101/update_user_list.rb +0 -82
- data/examples/v201101/upload_image.rb +0 -90
- data/examples/v201109/add_ads.rb +0 -174
- data/examples/v201109/check_campaigns.rb +0 -123
- data/examples/v201109/delete_bulk_mutate_job.rb +0 -87
- data/examples/v201109/delete_experiment.rb +0 -78
- data/examples/v201109/delete_user_list.rb +0 -78
- data/examples/v201109/get_ad_group_bid_landscape.rb +0 -94
- data/examples/v201109/get_all_ad_extension_overrides.rb +0 -82
- data/examples/v201109/get_all_ad_group_criteria.rb +0 -90
- data/examples/v201109/get_all_ad_params.rb +0 -86
- data/examples/v201109/get_all_campaign_ad_extensions.rb +0 -87
- data/examples/v201109/get_all_campaign_targets.rb +0 -74
- data/examples/v201109/get_all_conversions.rb +0 -79
- data/examples/v201109/get_all_experiments.rb +0 -89
- data/examples/v201109/get_all_languages.rb +0 -73
- data/examples/v201109/get_all_paused_campaigns.rb +0 -83
- data/examples/v201109/get_all_user_lists.rb +0 -78
- data/examples/v201109/get_all_videos.rb +0 -78
- data/examples/v201109/get_bulk_mutate_job.rb +0 -97
- data/examples/v201109/get_conversion_optimizer_eligibility.rb +0 -93
- data/examples/v201109/get_geo_location_info.rb +0 -99
- data/examples/v201109/get_method_cost.rb +0 -87
- data/examples/v201109/get_operation_count.rb +0 -79
- data/examples/v201109/get_total_usage_units_per_month.rb +0 -74
- data/examples/v201109/oauth_report_download.rb +0 -97
- data/examples/v201109/perform_bulk_mutate_job.rb +0 -212
- data/examples/v201109/update_conversion.rb +0 -87
- data/examples/v201109/update_user_list.rb +0 -82
- data/lib/adwords_api/v13/account_service.rb +0 -48
- data/lib/adwords_api/v13/account_service_registry.rb +0 -41
- data/lib/adwords_api/v13/report_service.rb +0 -65
- data/lib/adwords_api/v13/report_service_registry.rb +0 -41
- data/lib/adwords_api/v200909/ad_extension_override_service.rb +0 -36
- data/lib/adwords_api/v200909/ad_extension_override_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/ad_group_ad_service.rb +0 -36
- data/lib/adwords_api/v200909/ad_group_ad_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/ad_group_criterion_service.rb +0 -36
- data/lib/adwords_api/v200909/ad_group_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/ad_group_service.rb +0 -36
- data/lib/adwords_api/v200909/ad_group_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/ad_param_service.rb +0 -36
- data/lib/adwords_api/v200909/ad_param_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/bulk_mutate_job_service.rb +0 -36
- data/lib/adwords_api/v200909/bulk_mutate_job_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/campaign_ad_extension_service.rb +0 -36
- data/lib/adwords_api/v200909/campaign_ad_extension_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/campaign_criterion_service.rb +0 -36
- data/lib/adwords_api/v200909/campaign_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/campaign_service.rb +0 -36
- data/lib/adwords_api/v200909/campaign_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/campaign_target_service.rb +0 -36
- data/lib/adwords_api/v200909/campaign_target_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/geo_location_service.rb +0 -32
- data/lib/adwords_api/v200909/geo_location_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/info_service.rb +0 -32
- data/lib/adwords_api/v200909/info_service_registry.rb +0 -44
- data/lib/adwords_api/v200909/targeting_idea_service.rb +0 -36
- data/lib/adwords_api/v200909/targeting_idea_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/ad_extension_override_service.rb +0 -36
- data/lib/adwords_api/v201003/ad_extension_override_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/ad_group_ad_service.rb +0 -36
- data/lib/adwords_api/v201003/ad_group_ad_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/ad_group_criterion_service.rb +0 -36
- data/lib/adwords_api/v201003/ad_group_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/ad_group_service.rb +0 -36
- data/lib/adwords_api/v201003/ad_group_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/ad_param_service.rb +0 -36
- data/lib/adwords_api/v201003/ad_param_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/bid_landscape_service.rb +0 -32
- data/lib/adwords_api/v201003/bid_landscape_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/bulk_mutate_job_service.rb +0 -36
- data/lib/adwords_api/v201003/bulk_mutate_job_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/campaign_ad_extension_service.rb +0 -36
- data/lib/adwords_api/v201003/campaign_ad_extension_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/campaign_criterion_service.rb +0 -36
- data/lib/adwords_api/v201003/campaign_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/campaign_service.rb +0 -36
- data/lib/adwords_api/v201003/campaign_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/campaign_target_service.rb +0 -36
- data/lib/adwords_api/v201003/campaign_target_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/geo_location_service.rb +0 -32
- data/lib/adwords_api/v201003/geo_location_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/info_service.rb +0 -32
- data/lib/adwords_api/v201003/info_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/media_service.rb +0 -36
- data/lib/adwords_api/v201003/media_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/report_definition_service.rb +0 -49
- data/lib/adwords_api/v201003/report_definition_service_registry.rb +0 -44
- data/lib/adwords_api/v201003/targeting_idea_service.rb +0 -36
- data/lib/adwords_api/v201003/targeting_idea_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/ad_extension_override_service.rb +0 -36
- data/lib/adwords_api/v201008/ad_extension_override_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/ad_group_ad_service.rb +0 -36
- data/lib/adwords_api/v201008/ad_group_ad_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/ad_group_criterion_service.rb +0 -36
- data/lib/adwords_api/v201008/ad_group_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/ad_group_service.rb +0 -36
- data/lib/adwords_api/v201008/ad_group_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/ad_param_service.rb +0 -36
- data/lib/adwords_api/v201008/ad_param_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/alert_service.rb +0 -32
- data/lib/adwords_api/v201008/alert_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/bid_landscape_service.rb +0 -32
- data/lib/adwords_api/v201008/bid_landscape_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/bulk_mutate_job_service.rb +0 -36
- data/lib/adwords_api/v201008/bulk_mutate_job_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/campaign_ad_extension_service.rb +0 -36
- data/lib/adwords_api/v201008/campaign_ad_extension_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/campaign_criterion_service.rb +0 -36
- data/lib/adwords_api/v201008/campaign_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/campaign_service.rb +0 -36
- data/lib/adwords_api/v201008/campaign_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/campaign_target_service.rb +0 -36
- data/lib/adwords_api/v201008/campaign_target_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/customer_sync_service.rb +0 -32
- data/lib/adwords_api/v201008/customer_sync_service_registry.rb +0 -45
- data/lib/adwords_api/v201008/experiment_service.rb +0 -36
- data/lib/adwords_api/v201008/experiment_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/geo_location_service.rb +0 -32
- data/lib/adwords_api/v201008/geo_location_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/info_service.rb +0 -32
- data/lib/adwords_api/v201008/info_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/media_service.rb +0 -36
- data/lib/adwords_api/v201008/media_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/report_definition_service.rb +0 -49
- data/lib/adwords_api/v201008/report_definition_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/serviced_account_service.rb +0 -32
- data/lib/adwords_api/v201008/serviced_account_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/targeting_idea_service.rb +0 -36
- data/lib/adwords_api/v201008/targeting_idea_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/traffic_estimator_service.rb +0 -32
- data/lib/adwords_api/v201008/traffic_estimator_service_registry.rb +0 -44
- data/lib/adwords_api/v201008/user_list_service.rb +0 -36
- data/lib/adwords_api/v201008/user_list_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/ad_extension_override_service.rb +0 -36
- data/lib/adwords_api/v201101/ad_extension_override_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/ad_group_ad_service.rb +0 -36
- data/lib/adwords_api/v201101/ad_group_ad_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/ad_group_criterion_service.rb +0 -36
- data/lib/adwords_api/v201101/ad_group_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/ad_group_service.rb +0 -36
- data/lib/adwords_api/v201101/ad_group_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/ad_param_service.rb +0 -36
- data/lib/adwords_api/v201101/ad_param_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/alert_service.rb +0 -32
- data/lib/adwords_api/v201101/alert_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/bulk_mutate_job_service.rb +0 -36
- data/lib/adwords_api/v201101/bulk_mutate_job_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/bulk_opportunity_service.rb +0 -32
- data/lib/adwords_api/v201101/bulk_opportunity_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/campaign_ad_extension_service.rb +0 -36
- data/lib/adwords_api/v201101/campaign_ad_extension_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/campaign_criterion_service.rb +0 -36
- data/lib/adwords_api/v201101/campaign_criterion_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/campaign_service.rb +0 -36
- data/lib/adwords_api/v201101/campaign_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/campaign_target_service.rb +0 -36
- data/lib/adwords_api/v201101/campaign_target_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/conversion_tracker_service.rb +0 -36
- data/lib/adwords_api/v201101/conversion_tracker_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/customer_sync_service.rb +0 -32
- data/lib/adwords_api/v201101/customer_sync_service_registry.rb +0 -45
- data/lib/adwords_api/v201101/data_service.rb +0 -36
- data/lib/adwords_api/v201101/data_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/experiment_service.rb +0 -36
- data/lib/adwords_api/v201101/experiment_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/geo_location_service.rb +0 -32
- data/lib/adwords_api/v201101/geo_location_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/info_service.rb +0 -32
- data/lib/adwords_api/v201101/info_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/media_service.rb +0 -36
- data/lib/adwords_api/v201101/media_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/report_definition_service.rb +0 -49
- data/lib/adwords_api/v201101/report_definition_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/serviced_account_service.rb +0 -32
- data/lib/adwords_api/v201101/serviced_account_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/targeting_idea_service.rb +0 -36
- data/lib/adwords_api/v201101/targeting_idea_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/traffic_estimator_service.rb +0 -32
- data/lib/adwords_api/v201101/traffic_estimator_service_registry.rb +0 -44
- data/lib/adwords_api/v201101/user_list_service.rb +0 -36
- data/lib/adwords_api/v201101/user_list_service_registry.rb +0 -44
@@ -1,108 +0,0 @@
|
|
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 retrieves keywords that are related to a given keyword.
|
21
|
-
#
|
22
|
-
# Tags: TargetingIdeaService.get
|
23
|
-
|
24
|
-
require 'rubygems'
|
25
|
-
require 'adwords_api'
|
26
|
-
require 'adwords_api/utils'
|
27
|
-
|
28
|
-
API_VERSION = :v201003
|
29
|
-
PAGE_SIZE = 100
|
30
|
-
|
31
|
-
def get_related_keywords()
|
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
|
-
targeting_idea_srv = adwords.service(:TargetingIdeaService, API_VERSION)
|
41
|
-
|
42
|
-
keyword_text = 'INSERT_KEYWORD_TEXT_HERE'
|
43
|
-
|
44
|
-
# Construct selector object.
|
45
|
-
selector = {
|
46
|
-
:idea_type => 'KEYWORD',
|
47
|
-
:request_type => 'IDEAS',
|
48
|
-
:requested_attribute_types => ['KEYWORD'],
|
49
|
-
:search_parameters => [{
|
50
|
-
# The 'xsi_type' field allows you to specify the xsi:type of the object
|
51
|
-
# being created. It's only necessary when you must provide an explicit
|
52
|
-
# type that the client library can't infer.
|
53
|
-
:xsi_type => 'RelatedToKeywordSearchParameter',
|
54
|
-
:keywords => [{
|
55
|
-
:text => keyword_text,
|
56
|
-
:match_type => 'EXACT'
|
57
|
-
}]
|
58
|
-
}],
|
59
|
-
:paging => {
|
60
|
-
:start_index => 0,
|
61
|
-
:number_results => PAGE_SIZE
|
62
|
-
}
|
63
|
-
}
|
64
|
-
|
65
|
-
# Define initial values.
|
66
|
-
offset = 0
|
67
|
-
results = []
|
68
|
-
|
69
|
-
begin
|
70
|
-
# Perform request.
|
71
|
-
page = targeting_idea_srv.get(selector)
|
72
|
-
results += page[:entries] if page and page[:entries]
|
73
|
-
|
74
|
-
# Prepare next page request.
|
75
|
-
offset += PAGE_SIZE
|
76
|
-
selector[:paging][:start_index] = offset
|
77
|
-
end while offset < page[:total_num_entries]
|
78
|
-
|
79
|
-
# Display results.
|
80
|
-
results.each do |result|
|
81
|
-
data = AdwordsApi::Utils.map(result[:data])
|
82
|
-
keyword = data['KEYWORD'][:value]
|
83
|
-
puts "Found keyword with text \"%s\" and match type \"%s\"" %
|
84
|
-
[keyword[:text], keyword[:match_type]]
|
85
|
-
end
|
86
|
-
puts "Total keywords related to \"%s\": %d." % [keyword_text, results.length]
|
87
|
-
end
|
88
|
-
|
89
|
-
if __FILE__ == $0
|
90
|
-
begin
|
91
|
-
get_related_keywords()
|
92
|
-
|
93
|
-
# HTTP errors.
|
94
|
-
rescue AdsCommon::Errors::HttpError => e
|
95
|
-
puts "HTTP Error: %s" % e
|
96
|
-
|
97
|
-
# API errors.
|
98
|
-
rescue AdwordsApi::Errors::ApiException => e
|
99
|
-
puts "Message: %s" % e.message
|
100
|
-
puts 'Errors:'
|
101
|
-
e.errors.each_with_index do |error, index|
|
102
|
-
puts "\tError [%d]:" % (index + 1)
|
103
|
-
error.each do |field, value|
|
104
|
-
puts "\t\t%s: %s" % [field, value]
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
108
|
-
end
|
@@ -1,107 +0,0 @@
|
|
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 retrieves URLs that have content keywords related to a given
|
21
|
-
# website.
|
22
|
-
#
|
23
|
-
# Tags: TargetingIdeaService.get
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
require 'adwords_api'
|
27
|
-
require 'adwords_api/utils'
|
28
|
-
|
29
|
-
API_VERSION = :v201003
|
30
|
-
PAGE_SIZE = 100
|
31
|
-
|
32
|
-
def get_related_placements()
|
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
|
-
targeting_idea_srv = adwords.service(:TargetingIdeaService, API_VERSION)
|
42
|
-
|
43
|
-
url = 'INSERT_PLACEMENT_URL_HERE'
|
44
|
-
|
45
|
-
# Construct selector.
|
46
|
-
selector = {
|
47
|
-
:idea_type => 'PLACEMENT',
|
48
|
-
:request_type => 'IDEAS',
|
49
|
-
:requested_attribute_types => ['PLACEMENT'],
|
50
|
-
:search_parameters => [{
|
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 => 'RelatedToUrlSearchParameter',
|
55
|
-
:urls => [url],
|
56
|
-
:include_sub_urls => false
|
57
|
-
}],
|
58
|
-
:paging => {
|
59
|
-
:start_index => 0,
|
60
|
-
:number_results => PAGE_SIZE
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
# Define initial values.
|
65
|
-
offset = 0
|
66
|
-
results = []
|
67
|
-
|
68
|
-
begin
|
69
|
-
# Perform request.
|
70
|
-
page = targeting_idea_srv.get(selector)
|
71
|
-
results += page[:entries] if page and page[:entries]
|
72
|
-
|
73
|
-
# Prepare next page request.
|
74
|
-
offset += PAGE_SIZE
|
75
|
-
selector[:paging][:start_index] = offset
|
76
|
-
end while offset < page[:total_num_entries]
|
77
|
-
|
78
|
-
# Display results.
|
79
|
-
results.each do |result|
|
80
|
-
data = AdwordsApi::Utils.map(result[:data])
|
81
|
-
placement = data['PLACEMENT'][:value]
|
82
|
-
puts "Related content keywords found at URL [%s]" % placement[:url]
|
83
|
-
end
|
84
|
-
puts "Total URLs found with keywords related to keywords at [%s]: %d." %
|
85
|
-
[url, results.length]
|
86
|
-
end
|
87
|
-
|
88
|
-
if __FILE__ == $0
|
89
|
-
begin
|
90
|
-
get_related_placements()
|
91
|
-
|
92
|
-
# HTTP errors.
|
93
|
-
rescue AdsCommon::Errors::HttpError => e
|
94
|
-
puts "HTTP Error: %s" % e
|
95
|
-
|
96
|
-
# API errors.
|
97
|
-
rescue AdwordsApi::Errors::ApiException => e
|
98
|
-
puts "Message: %s" % e.message
|
99
|
-
puts 'Errors:'
|
100
|
-
e.errors.each_with_index do |error, index|
|
101
|
-
puts "\tError [%d]:" % (index + 1)
|
102
|
-
error.each do |field, value|
|
103
|
-
puts "\t\t%s: %s" % [field, value]
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
end
|
@@ -1,72 +0,0 @@
|
|
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 gets the list of possible report fields for a report type.
|
21
|
-
#
|
22
|
-
# Tags: ReportDefinitionService.getReportFields
|
23
|
-
|
24
|
-
require 'rubygems'
|
25
|
-
require 'adwords_api'
|
26
|
-
|
27
|
-
API_VERSION = :v201003
|
28
|
-
|
29
|
-
def get_report_fields()
|
30
|
-
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
31
|
-
# when called without parameters.
|
32
|
-
adwords = AdwordsApi::Api.new
|
33
|
-
|
34
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
35
|
-
# the configuration file or provide your own logger:
|
36
|
-
# adwords.logger = Logger.new('adwords_xml.log')
|
37
|
-
|
38
|
-
report_def_srv = adwords.service(:ReportDefinitionService, API_VERSION)
|
39
|
-
|
40
|
-
report_type = 'INSERT_REPORT_TYPE_HERE'
|
41
|
-
|
42
|
-
# Get report fields.
|
43
|
-
fields = report_def_srv.get_report_fields(report_type)
|
44
|
-
if fields
|
45
|
-
puts 'Report type \'%s\' contains the following fields:' % report_type
|
46
|
-
fields.each do |field|
|
47
|
-
puts ' - %s (%s)' % [field[:field_name], field[:field_type]]
|
48
|
-
puts ' := [%s]' % field[:enum_values].join(', ') if field[:enum_values]
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
if __FILE__ == $0
|
54
|
-
begin
|
55
|
-
get_report_fields()
|
56
|
-
|
57
|
-
# HTTP errors.
|
58
|
-
rescue AdsCommon::Errors::HttpError => e
|
59
|
-
puts "HTTP Error: %s" % e
|
60
|
-
|
61
|
-
# API errors.
|
62
|
-
rescue AdwordsApi::Errors::ApiException => e
|
63
|
-
puts "Message: %s" % e.message
|
64
|
-
puts 'Errors:'
|
65
|
-
e.errors.each_with_index do |error, index|
|
66
|
-
puts "\tError [%d]:" % (index + 1)
|
67
|
-
error.each do |field, value|
|
68
|
-
puts "\t\t%s: %s" % [field, value]
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
@@ -1,74 +0,0 @@
|
|
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 retrieve the total number of API units that
|
21
|
-
# can be used by the developer token making the call, for the current month.
|
22
|
-
#
|
23
|
-
# Tags: InfoService.get
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
require 'adwords_api'
|
27
|
-
|
28
|
-
API_VERSION = :v201003
|
29
|
-
|
30
|
-
def get_total_usage_units_per_month()
|
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
|
-
info_srv = adwords.service(:InfoService, API_VERSION)
|
40
|
-
|
41
|
-
selector = {
|
42
|
-
:api_usage_type => 'TOTAL_USAGE_API_UNITS_PER_MONTH'
|
43
|
-
}
|
44
|
-
|
45
|
-
# Get the usage info.
|
46
|
-
adwords.use_mcc do
|
47
|
-
info = info_srv.get(selector)
|
48
|
-
if info
|
49
|
-
puts 'The total number of API units available this month is %d.' %
|
50
|
-
info[:cost]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
if __FILE__ == $0
|
56
|
-
begin
|
57
|
-
get_total_usage_units_per_month()
|
58
|
-
|
59
|
-
# HTTP errors.
|
60
|
-
rescue AdsCommon::Errors::HttpError => e
|
61
|
-
puts "HTTP Error: %s" % e
|
62
|
-
|
63
|
-
# API errors.
|
64
|
-
rescue AdwordsApi::Errors::ApiException => e
|
65
|
-
puts "Message: %s" % e.message
|
66
|
-
puts 'Errors:'
|
67
|
-
e.errors.each_with_index do |error, index|
|
68
|
-
puts "\tError [%d]:" % (index + 1)
|
69
|
-
error.each do |field, value|
|
70
|
-
puts "\t\t%s: %s" % [field, value]
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
@@ -1,79 +0,0 @@
|
|
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 retrieve the number of API units recorded for
|
21
|
-
# the developer token being used to make this call over the given date range.
|
22
|
-
#
|
23
|
-
# Tags: InfoService.get
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
require 'adwords_api'
|
27
|
-
|
28
|
-
API_VERSION = :v201003
|
29
|
-
|
30
|
-
def get_unit_count()
|
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
|
-
info_srv = adwords.service(:InfoService, API_VERSION)
|
40
|
-
|
41
|
-
selector = {
|
42
|
-
:api_usage_type => 'UNIT_COUNT',
|
43
|
-
:date_range => {
|
44
|
-
:min => Time.now.strftime('%Y%m01'),
|
45
|
-
:max => Time.now.strftime('%Y%m%d')
|
46
|
-
}
|
47
|
-
}
|
48
|
-
|
49
|
-
# Get the unit info.
|
50
|
-
adwords.use_mcc do
|
51
|
-
info = info_srv.get(selector)
|
52
|
-
if info
|
53
|
-
puts 'The total number of units consumed from %s to %s is %d.' %
|
54
|
-
[selector[:date_range][:min], selector[:date_range][:max],
|
55
|
-
info[:cost]]
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
if __FILE__ == $0
|
61
|
-
begin
|
62
|
-
get_unit_count()
|
63
|
-
|
64
|
-
# HTTP errors.
|
65
|
-
rescue AdsCommon::Errors::HttpError => e
|
66
|
-
puts "HTTP Error: %s" % e
|
67
|
-
|
68
|
-
# API errors.
|
69
|
-
rescue AdwordsApi::Errors::ApiException => e
|
70
|
-
puts "Message: %s" % e.message
|
71
|
-
puts 'Errors:'
|
72
|
-
e.errors.each_with_index do |error, index|
|
73
|
-
puts "\tError [%d]:" % (index + 1)
|
74
|
-
error.each do |field, value|
|
75
|
-
puts "\t\t%s: %s" % [field, value]
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
@@ -1,212 +0,0 @@
|
|
1
|
-
#!/usr/bin/ruby
|
2
|
-
#
|
3
|
-
# Author:: sgomes@google.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 code sample illustrates how to perform asynchronous requests using the
|
21
|
-
# BulkMutateJobService.
|
22
|
-
#
|
23
|
-
# Tags: BulkMutateJobService.mutate
|
24
|
-
|
25
|
-
require 'rubygems'
|
26
|
-
require 'adwords_api'
|
27
|
-
|
28
|
-
API_VERSION = :v201003
|
29
|
-
|
30
|
-
def perform_bulk_mutate_job()
|
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
|
-
bulk_mutate_job_srv = adwords.service(:BulkMutateJobService, API_VERSION)
|
40
|
-
|
41
|
-
campaign_id = 'INSERT_CAMPAIGN_ID_HERE'.to_i
|
42
|
-
ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i
|
43
|
-
|
44
|
-
# Create an AdGroupAdOperation to add a text ad.
|
45
|
-
text_ad_operation = {
|
46
|
-
# The 'xsi_type' field allows you to specify the xsi:type of the object
|
47
|
-
# being created. It's only necessary when you must provide an explicit
|
48
|
-
# type that the client library can't infer.
|
49
|
-
:xsi_type => 'AdGroupAdOperation',
|
50
|
-
:operator => 'ADD',
|
51
|
-
:operand => {
|
52
|
-
:ad_group_id => ad_group_id,
|
53
|
-
:ad => {
|
54
|
-
:xsi_type => 'TextAd',
|
55
|
-
:headline => 'Luxury Cruise to Mars',
|
56
|
-
:description1 => 'Visit the Red Planet in style.',
|
57
|
-
:description2 => 'Low-gravity fun for everyone!',
|
58
|
-
:url => 'http://www.example.com',
|
59
|
-
:display_url => 'www.example.com',
|
60
|
-
}
|
61
|
-
}
|
62
|
-
}
|
63
|
-
|
64
|
-
# Create an operation stream for the ad.
|
65
|
-
ad_stream = {
|
66
|
-
:scoping_entity_id => {
|
67
|
-
:type => 'CAMPAIGN_ID',
|
68
|
-
:value => campaign_id
|
69
|
-
},
|
70
|
-
:operations => [text_ad_operation]
|
71
|
-
}
|
72
|
-
|
73
|
-
# Create AdGroupCriterionOperations to add keywords.
|
74
|
-
kwd_operations = []
|
75
|
-
1.upto(100) do |index|
|
76
|
-
kwd_operation = {
|
77
|
-
:xsi_type => 'AdGroupCriterionOperation',
|
78
|
-
:operator => 'ADD',
|
79
|
-
:operand => {
|
80
|
-
:xsi_type => 'BiddableAdGroupCriterion',
|
81
|
-
:ad_group_id => ad_group_id,
|
82
|
-
:criterion => {
|
83
|
-
:xsi_type => 'Keyword',
|
84
|
-
:match_type => 'BROAD',
|
85
|
-
:text => 'mars%s' % index
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
kwd_operations << kwd_operation
|
90
|
-
end
|
91
|
-
|
92
|
-
# Create an operation stream for the keywords.
|
93
|
-
kwd_stream = {
|
94
|
-
:scoping_entity_id => {
|
95
|
-
:type => 'CAMPAIGN_ID',
|
96
|
-
:value => campaign_id
|
97
|
-
},
|
98
|
-
:operations => kwd_operations
|
99
|
-
}
|
100
|
-
|
101
|
-
# Create a BulkMutateJobService operation with the first part of the job.
|
102
|
-
job_operation_1 = {
|
103
|
-
:xsi_type => 'JobOperation',
|
104
|
-
# We're using ADD here because we're creating a new job.
|
105
|
-
:operator => 'ADD',
|
106
|
-
:operand => {
|
107
|
-
:xsi_type => 'BulkMutateJob',
|
108
|
-
:num_request_parts => 2,
|
109
|
-
:request => {
|
110
|
-
# The part index is zero-based.
|
111
|
-
:part_index => 0,
|
112
|
-
:operation_streams => [ad_stream]
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
116
|
-
|
117
|
-
# Call mutate() to create a new job by uploading the first part.
|
118
|
-
response_1 = bulk_mutate_job_srv.mutate(job_operation_1)
|
119
|
-
job_id = response_1[:id]
|
120
|
-
puts 'Job id %d was successfully created.' % job_id
|
121
|
-
|
122
|
-
# Similarly, create the next part of the job.
|
123
|
-
job_operation_2 = {
|
124
|
-
:xsi_type => 'JobOperation',
|
125
|
-
# We're using SET now because we're adding a new part to an existing job.
|
126
|
-
# Using ADD again would create a new job altogether.
|
127
|
-
:operator => 'SET',
|
128
|
-
:operand => {
|
129
|
-
:xsi_type => 'BulkMutateJob',
|
130
|
-
:num_request_parts => 2,
|
131
|
-
# Use the ID from the job we added.
|
132
|
-
:id => job_id,
|
133
|
-
:request => {
|
134
|
-
# Second part, hence index 1.
|
135
|
-
:part_index => 1,
|
136
|
-
:operation_streams => [kwd_stream]
|
137
|
-
}
|
138
|
-
}
|
139
|
-
}
|
140
|
-
|
141
|
-
# And call mutate() to upload the second part. Since this is the final part,
|
142
|
-
# the job is automatically cleared for execution.
|
143
|
-
response_2 = bulk_mutate_job_srv.mutate(job_operation_2)
|
144
|
-
puts 'Second part of job %d successfully submitted.' % job_id
|
145
|
-
|
146
|
-
# Wait for the job to complete.
|
147
|
-
selector = {
|
148
|
-
:job_ids => [job_id]
|
149
|
-
}
|
150
|
-
sleep_interval = 10
|
151
|
-
status = nil
|
152
|
-
get_response = nil
|
153
|
-
while status != 'COMPLETED' && status != 'FAILED'
|
154
|
-
unless status.nil?
|
155
|
-
puts "Current status is #{status}, waiting #{sleep_interval} seconds"
|
156
|
-
sleep(sleep_interval) unless status.nil?
|
157
|
-
end
|
158
|
-
get_response = bulk_mutate_job_srv.get(selector)
|
159
|
-
if get_response and get_response.size > 0
|
160
|
-
status = get_response.first[:status]
|
161
|
-
else
|
162
|
-
puts 'Error retrieving job status; aborting.'
|
163
|
-
exit
|
164
|
-
end
|
165
|
-
end
|
166
|
-
|
167
|
-
if status == 'COMPLETED'
|
168
|
-
puts 'Job completed!'
|
169
|
-
# Retrieve the results for the parts.
|
170
|
-
0.upto(job_operation_1[:operand][:num_request_parts] - 1) do |part_index|
|
171
|
-
selector = {
|
172
|
-
:job_ids => [job_id],
|
173
|
-
# Retrieve results for the current part.
|
174
|
-
:result_part_index => part_index
|
175
|
-
}
|
176
|
-
results = bulk_mutate_job_srv.get(selector)
|
177
|
-
if results
|
178
|
-
results.each do |result|
|
179
|
-
puts 'Part %d/%d of job #%d has successfully completed' %
|
180
|
-
[part_index + 1, job_operation_1[:operand][:num_request_parts],
|
181
|
-
job_id]
|
182
|
-
end
|
183
|
-
else
|
184
|
-
puts 'Error retrieving job results; aborting.'
|
185
|
-
exit
|
186
|
-
end
|
187
|
-
end
|
188
|
-
else
|
189
|
-
puts 'Job failed: ' + get_response.first[:failure_reason]
|
190
|
-
end
|
191
|
-
end
|
192
|
-
|
193
|
-
if __FILE__ == $0
|
194
|
-
begin
|
195
|
-
perform_bulk_mutate_job()
|
196
|
-
|
197
|
-
# HTTP errors.
|
198
|
-
rescue AdsCommon::Errors::HttpError => e
|
199
|
-
puts "HTTP Error: %s" % e
|
200
|
-
|
201
|
-
# API errors.
|
202
|
-
rescue AdwordsApi::Errors::ApiException => e
|
203
|
-
puts "Message: %s" % e.message
|
204
|
-
puts 'Errors:'
|
205
|
-
e.errors.each_with_index do |error, index|
|
206
|
-
puts "\tError [%d]:" % (index + 1)
|
207
|
-
error.each do |field, value|
|
208
|
-
puts "\t\t%s: %s" % [field, value]
|
209
|
-
end
|
210
|
-
end
|
211
|
-
end
|
212
|
-
end
|