google-adwords-api 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog +9 -0
- data/README +26 -10
- data/Rakefile +1 -1
- data/examples/v200909/add_ad_group.rb +2 -2
- data/examples/v200909/add_ads.rb +4 -4
- data/examples/v200909/add_campaign.rb +2 -2
- data/examples/v200909/check_campaigns.rb +4 -4
- data/examples/v201003/add_ad_group.rb +2 -2
- data/examples/v201003/add_ads.rb +6 -6
- data/examples/v201003/add_campaign.rb +2 -2
- data/examples/v201003/add_keywords_performance_report_definition.rb +2 -2
- data/examples/v201003/check_campaigns.rb +4 -4
- data/examples/v201008/add_ad_group.rb +2 -2
- data/examples/v201008/add_ads.rb +7 -7
- data/examples/v201008/add_campaign.rb +2 -2
- data/examples/v201008/add_experiment.rb +5 -5
- data/examples/v201008/add_keywords_performance_report_definition.rb +2 -2
- data/examples/v201008/add_user_list.rb +2 -2
- data/examples/v201008/check_campaigns.rb +4 -4
- data/examples/v201008/get_account_hierarchy.rb +8 -11
- data/examples/v201101/add_ad_group.rb +2 -2
- data/examples/v201101/add_ads.rb +6 -6
- data/examples/v201101/add_campaign.rb +2 -2
- data/examples/v201101/add_conversion.rb +4 -4
- data/examples/v201101/add_experiment.rb +5 -5
- data/examples/v201101/add_keywords_performance_report_definition.rb +2 -2
- data/examples/v201101/add_user_list.rb +3 -3
- data/examples/v201101/check_campaigns.rb +4 -4
- data/examples/v201101/get_account_hierarchy.rb +7 -9
- data/examples/v201109/add_ad_extension_override.rb +82 -0
- data/examples/v201109/add_ad_group.rb +89 -0
- data/examples/v201109/add_ad_group_criteria.rb +109 -0
- data/examples/v201109/add_ads.rb +174 -0
- data/examples/v201109/add_campaign.rb +99 -0
- data/examples/v201109/add_campaign_ad_extension.rb +121 -0
- data/examples/v201109/add_campaign_targeting_criteria.rb +102 -0
- data/examples/{v201101/add_mcc_report_definition.rb → v201109/add_conversion.rb} +26 -28
- data/examples/v201109/add_experiment.rb +153 -0
- data/examples/v201109/add_negative_campaign_criterion.rb +87 -0
- data/examples/v201109/add_user_list.rb +113 -0
- data/examples/v201109/check_campaigns.rb +123 -0
- data/examples/v201109/delete_ad.rb +85 -0
- data/examples/v201109/delete_ad_group.rb +77 -0
- data/examples/v201109/delete_ad_group_criterion.rb +86 -0
- data/examples/v201109/delete_bulk_mutate_job.rb +87 -0
- data/examples/v201109/delete_campaign.rb +78 -0
- data/examples/v201109/delete_experiment.rb +78 -0
- data/examples/v201109/delete_user_list.rb +78 -0
- data/examples/v201109/download_adhoc_report.rb +79 -0
- data/examples/v201109/download_report.rb +67 -0
- data/examples/v201109/get_account_hierarchy.rb +93 -0
- data/examples/v201109/get_ad_group_bid_landscape.rb +94 -0
- data/examples/v201109/get_all_account_changes.rb +137 -0
- data/examples/v201109/get_all_active_ad_group_criteria.rb +98 -0
- data/examples/v201109/get_all_ad_extension_overrides.rb +82 -0
- data/examples/v201109/get_all_ad_group_criteria.rb +90 -0
- data/examples/v201109/get_all_ad_groups.rb +85 -0
- data/examples/v201109/get_all_ad_params.rb +86 -0
- data/examples/v201109/get_all_ads.rb +90 -0
- data/examples/v201109/get_all_campaign_ad_extensions.rb +87 -0
- data/examples/v201109/get_all_campaign_targets.rb +74 -0
- data/examples/v201109/get_all_campaigns.rb +77 -0
- data/examples/v201109/get_all_carriers.rb +72 -0
- data/examples/v201109/get_all_conversions.rb +79 -0
- data/examples/v201109/get_all_disapproved_ads.rb +93 -0
- data/examples/v201109/get_all_experiments.rb +89 -0
- data/examples/v201109/get_all_images.rb +82 -0
- data/examples/v201109/get_all_languages.rb +73 -0
- data/examples/v201109/get_all_paused_campaigns.rb +83 -0
- data/examples/v201109/get_all_report_definitions.rb +75 -0
- data/examples/v201109/get_all_user_lists.rb +78 -0
- data/examples/v201109/get_all_videos.rb +78 -0
- data/examples/v201109/get_bulk_mutate_job.rb +97 -0
- data/examples/v201109/get_campaign_alerts.rb +95 -0
- data/examples/v201109/get_client_customer_id.rb +87 -0
- data/examples/v201109/get_conversion_optimizer_eligibility.rb +93 -0
- data/examples/v201109/get_criterion_bid_landscape.rb +93 -0
- data/examples/v201109/get_geo_location_info.rb +99 -0
- data/examples/v201109/get_keyword_opportunities.rb +95 -0
- data/examples/v201109/get_location_criteria.rb +103 -0
- data/examples/v201109/get_method_cost.rb +87 -0
- data/examples/v201109/get_operation_count.rb +79 -0
- data/examples/v201109/get_related_keywords.rb +108 -0
- data/examples/v201109/get_related_placements.rb +107 -0
- data/examples/v201109/get_report_fields.rb +72 -0
- data/examples/v201109/get_total_usage_units_per_month.rb +74 -0
- data/examples/v201109/get_traffic_estimates.rb +129 -0
- data/examples/v201109/get_unit_count.rb +81 -0
- data/examples/v201109/handle_partial_failures.rb +127 -0
- data/examples/v201109/handle_policy_violation_error.rb +138 -0
- data/examples/v201109/handle_second_factor.rb +87 -0
- data/examples/v201109/oauth_handling.rb +95 -0
- data/examples/v201109/perform_bulk_mutate_job.rb +212 -0
- data/examples/v201109/perform_mutate_job.rb +177 -0
- data/examples/v201109/promote_experiment.rb +79 -0
- data/examples/v201109/set_ad_params.rb +115 -0
- data/examples/v201109/update_ad.rb +86 -0
- data/examples/v201109/update_ad_group.rb +81 -0
- data/examples/v201109/update_ad_group_criterion.rb +99 -0
- data/examples/v201109/update_campaign.rb +84 -0
- data/examples/v201109/update_conversion.rb +87 -0
- data/examples/v201109/update_user_list.rb +82 -0
- data/examples/v201109/upload_image.rb +90 -0
- data/lib/adwords_api.rb +54 -50
- data/lib/adwords_api/api_config.rb +70 -14
- data/lib/adwords_api/credential_handler.rb +32 -13
- data/lib/adwords_api/errors.rb +12 -0
- data/lib/adwords_api/extensions.rb +8 -118
- data/lib/adwords_api/report_utils.rb +198 -0
- data/lib/adwords_api/utils.rb +5 -2
- data/lib/adwords_api/v13/account_service.rb +11 -11
- data/lib/adwords_api/v13/account_service_registry.rb +5 -3
- data/lib/adwords_api/v13/report_service.rb +15 -15
- data/lib/adwords_api/v13/report_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/ad_extension_override_service.rb +5 -5
- data/lib/adwords_api/v200909/ad_extension_override_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/ad_group_ad_service.rb +5 -5
- data/lib/adwords_api/v200909/ad_group_ad_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/ad_group_criterion_service.rb +5 -5
- data/lib/adwords_api/v200909/ad_group_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/ad_group_service.rb +5 -5
- data/lib/adwords_api/v200909/ad_group_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/ad_param_service.rb +5 -5
- data/lib/adwords_api/v200909/ad_param_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/bulk_mutate_job_service.rb +5 -5
- data/lib/adwords_api/v200909/bulk_mutate_job_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/campaign_ad_extension_service.rb +5 -5
- data/lib/adwords_api/v200909/campaign_ad_extension_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/campaign_criterion_service.rb +5 -5
- data/lib/adwords_api/v200909/campaign_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/campaign_service.rb +5 -5
- data/lib/adwords_api/v200909/campaign_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/campaign_target_service.rb +5 -5
- data/lib/adwords_api/v200909/campaign_target_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/geo_location_service.rb +3 -3
- data/lib/adwords_api/v200909/geo_location_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/info_service.rb +3 -3
- data/lib/adwords_api/v200909/info_service_registry.rb +5 -3
- data/lib/adwords_api/v200909/targeting_idea_service.rb +5 -5
- data/lib/adwords_api/v200909/targeting_idea_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/ad_extension_override_service.rb +5 -5
- data/lib/adwords_api/v201003/ad_extension_override_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/ad_group_ad_service.rb +5 -5
- data/lib/adwords_api/v201003/ad_group_ad_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/ad_group_criterion_service.rb +5 -5
- data/lib/adwords_api/v201003/ad_group_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/ad_group_service.rb +5 -5
- data/lib/adwords_api/v201003/ad_group_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/ad_param_service.rb +5 -5
- data/lib/adwords_api/v201003/ad_param_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/bid_landscape_service.rb +3 -3
- data/lib/adwords_api/v201003/bid_landscape_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/bulk_mutate_job_service.rb +5 -5
- data/lib/adwords_api/v201003/bulk_mutate_job_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/campaign_ad_extension_service.rb +5 -5
- data/lib/adwords_api/v201003/campaign_ad_extension_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/campaign_criterion_service.rb +5 -5
- data/lib/adwords_api/v201003/campaign_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/campaign_service.rb +5 -5
- data/lib/adwords_api/v201003/campaign_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/campaign_target_service.rb +5 -5
- data/lib/adwords_api/v201003/campaign_target_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/geo_location_service.rb +3 -3
- data/lib/adwords_api/v201003/geo_location_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/info_service.rb +3 -3
- data/lib/adwords_api/v201003/info_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/media_service.rb +5 -5
- data/lib/adwords_api/v201003/media_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/report_definition_service.rb +7 -7
- data/lib/adwords_api/v201003/report_definition_service_registry.rb +5 -3
- data/lib/adwords_api/v201003/targeting_idea_service.rb +5 -5
- data/lib/adwords_api/v201003/targeting_idea_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/ad_extension_override_service.rb +5 -5
- data/lib/adwords_api/v201008/ad_extension_override_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/ad_group_ad_service.rb +5 -5
- data/lib/adwords_api/v201008/ad_group_ad_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/ad_group_criterion_service.rb +5 -5
- data/lib/adwords_api/v201008/ad_group_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/ad_group_service.rb +5 -5
- data/lib/adwords_api/v201008/ad_group_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/ad_param_service.rb +5 -5
- data/lib/adwords_api/v201008/ad_param_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/alert_service.rb +3 -3
- data/lib/adwords_api/v201008/alert_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/bid_landscape_service.rb +3 -3
- data/lib/adwords_api/v201008/bid_landscape_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/bulk_mutate_job_service.rb +5 -5
- data/lib/adwords_api/v201008/bulk_mutate_job_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/campaign_ad_extension_service.rb +5 -5
- data/lib/adwords_api/v201008/campaign_ad_extension_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/campaign_criterion_service.rb +5 -5
- data/lib/adwords_api/v201008/campaign_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/campaign_service.rb +5 -5
- data/lib/adwords_api/v201008/campaign_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/campaign_target_service.rb +5 -5
- data/lib/adwords_api/v201008/campaign_target_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/customer_sync_service.rb +3 -3
- data/lib/adwords_api/v201008/customer_sync_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/experiment_service.rb +5 -5
- data/lib/adwords_api/v201008/experiment_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/geo_location_service.rb +3 -3
- data/lib/adwords_api/v201008/geo_location_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/info_service.rb +3 -3
- data/lib/adwords_api/v201008/info_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/media_service.rb +5 -5
- data/lib/adwords_api/v201008/media_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/report_definition_service.rb +7 -7
- data/lib/adwords_api/v201008/report_definition_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/serviced_account_service.rb +3 -3
- data/lib/adwords_api/v201008/serviced_account_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/targeting_idea_service.rb +5 -5
- data/lib/adwords_api/v201008/targeting_idea_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/traffic_estimator_service.rb +3 -3
- data/lib/adwords_api/v201008/traffic_estimator_service_registry.rb +5 -3
- data/lib/adwords_api/v201008/user_list_service.rb +5 -5
- data/lib/adwords_api/v201008/user_list_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/ad_extension_override_service.rb +5 -5
- data/lib/adwords_api/v201101/ad_extension_override_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/ad_group_ad_service.rb +5 -5
- data/lib/adwords_api/v201101/ad_group_ad_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/ad_group_criterion_service.rb +5 -5
- data/lib/adwords_api/v201101/ad_group_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/ad_group_service.rb +5 -5
- data/lib/adwords_api/v201101/ad_group_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/ad_param_service.rb +5 -5
- data/lib/adwords_api/v201101/ad_param_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/alert_service.rb +3 -3
- data/lib/adwords_api/v201101/alert_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/bulk_mutate_job_service.rb +5 -5
- data/lib/adwords_api/v201101/bulk_mutate_job_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/bulk_opportunity_service.rb +3 -3
- data/lib/adwords_api/v201101/bulk_opportunity_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/campaign_ad_extension_service.rb +5 -5
- data/lib/adwords_api/v201101/campaign_ad_extension_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/campaign_criterion_service.rb +5 -5
- data/lib/adwords_api/v201101/campaign_criterion_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/campaign_service.rb +5 -5
- data/lib/adwords_api/v201101/campaign_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/campaign_target_service.rb +5 -5
- data/lib/adwords_api/v201101/campaign_target_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/conversion_tracker_service.rb +5 -5
- data/lib/adwords_api/v201101/conversion_tracker_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/customer_sync_service.rb +3 -3
- data/lib/adwords_api/v201101/customer_sync_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/data_service.rb +5 -5
- data/lib/adwords_api/v201101/data_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/experiment_service.rb +5 -5
- data/lib/adwords_api/v201101/experiment_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/geo_location_service.rb +3 -3
- data/lib/adwords_api/v201101/geo_location_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/info_service.rb +3 -3
- data/lib/adwords_api/v201101/info_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/media_service.rb +5 -5
- data/lib/adwords_api/v201101/media_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/report_definition_service.rb +7 -15
- data/lib/adwords_api/v201101/report_definition_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/serviced_account_service.rb +3 -3
- data/lib/adwords_api/v201101/serviced_account_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/targeting_idea_service.rb +5 -5
- data/lib/adwords_api/v201101/targeting_idea_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/traffic_estimator_service.rb +3 -3
- data/lib/adwords_api/v201101/traffic_estimator_service_registry.rb +5 -3
- data/lib/adwords_api/v201101/user_list_service.rb +5 -5
- data/lib/adwords_api/v201101/user_list_service_registry.rb +5 -3
- data/lib/adwords_api/v201109/ad_extension_override_service.rb +36 -0
- data/lib/adwords_api/v201109/ad_extension_override_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/ad_group_ad_service.rb +36 -0
- data/lib/adwords_api/v201109/ad_group_ad_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/ad_group_criterion_service.rb +36 -0
- data/lib/adwords_api/v201109/ad_group_criterion_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/ad_group_service.rb +36 -0
- data/lib/adwords_api/v201109/ad_group_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/ad_param_service.rb +36 -0
- data/lib/adwords_api/v201109/ad_param_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/alert_service.rb +32 -0
- data/lib/adwords_api/v201109/alert_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/bulk_mutate_job_service.rb +36 -0
- data/lib/adwords_api/v201109/bulk_mutate_job_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/bulk_opportunity_service.rb +32 -0
- data/lib/adwords_api/v201109/bulk_opportunity_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/campaign_ad_extension_service.rb +36 -0
- data/lib/adwords_api/v201109/campaign_ad_extension_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/campaign_criterion_service.rb +36 -0
- data/lib/adwords_api/v201109/campaign_criterion_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/campaign_service.rb +36 -0
- data/lib/adwords_api/v201109/campaign_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/campaign_target_service.rb +36 -0
- data/lib/adwords_api/v201109/campaign_target_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/constant_data_service.rb +36 -0
- data/lib/adwords_api/v201109/constant_data_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/conversion_tracker_service.rb +36 -0
- data/lib/adwords_api/v201109/conversion_tracker_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/customer_sync_service.rb +32 -0
- data/lib/adwords_api/v201109/customer_sync_service_registry.rb +45 -0
- data/lib/adwords_api/v201109/data_service.rb +36 -0
- data/lib/adwords_api/v201109/data_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/experiment_service.rb +36 -0
- data/lib/adwords_api/v201109/experiment_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/geo_location_service.rb +32 -0
- data/lib/adwords_api/v201109/geo_location_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/info_service.rb +32 -0
- data/lib/adwords_api/v201109/info_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/location_criterion_service.rb +32 -0
- data/lib/adwords_api/v201109/location_criterion_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/media_service.rb +36 -0
- data/lib/adwords_api/v201109/media_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/mutate_job_service.rb +40 -0
- data/lib/adwords_api/v201109/mutate_job_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/report_definition_service.rb +45 -0
- data/lib/adwords_api/v201109/report_definition_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/serviced_account_service.rb +32 -0
- data/lib/adwords_api/v201109/serviced_account_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/targeting_idea_service.rb +36 -0
- data/lib/adwords_api/v201109/targeting_idea_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/traffic_estimator_service.rb +32 -0
- data/lib/adwords_api/v201109/traffic_estimator_service_registry.rb +44 -0
- data/lib/adwords_api/v201109/user_list_service.rb +36 -0
- data/lib/adwords_api/v201109/user_list_service_registry.rb +44 -0
- data/test/bugs/test_issue_00000031.rb +78 -0
- metadata +467 -342
- data/examples/v201101/download_mcc_report.rb +0 -113
- data/examples/v201101/download_mcc_report_as_file.rb +0 -114
- data/lib/adwords_api/v13/traffic_estimator_service.rb +0 -44
- data/lib/adwords_api/v13/traffic_estimator_service_registry.rb +0 -39
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby
|
|
2
|
-
#
|
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
|
-
#
|
|
5
|
-
# Copyright:: Copyright 2010, 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 and downloads a report from a report definition using MCC
|
|
21
|
-
# (cross-client) feature. To create a report definition, run
|
|
22
|
-
# add_mcc_report_definition.rb.
|
|
23
|
-
#
|
|
24
|
-
# Please note: This feature is still under development and may change before it
|
|
25
|
-
# is released.
|
|
26
|
-
#
|
|
27
|
-
# Tags: ReportDefinitionService
|
|
28
|
-
|
|
29
|
-
require 'rubygems'
|
|
30
|
-
require 'adwords_api'
|
|
31
|
-
require 'pp'
|
|
32
|
-
|
|
33
|
-
API_VERSION = :v201101
|
|
34
|
-
MAX_RETRIES = 10
|
|
35
|
-
RETRY_INTERVAL = 30
|
|
36
|
-
|
|
37
|
-
def download_mcc_report()
|
|
38
|
-
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
|
39
|
-
# when called without parameters.
|
|
40
|
-
adwords = AdwordsApi::Api.new
|
|
41
|
-
|
|
42
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
|
43
|
-
# the configuration file or provide your own logger:
|
|
44
|
-
# adwords.logger = Logger.new('adwords_xml.log')
|
|
45
|
-
|
|
46
|
-
report_def_srv = adwords.service(:ReportDefinitionService, API_VERSION)
|
|
47
|
-
|
|
48
|
-
report_definition_id = 'INSERT_REPORT_ID_HERE'.to_i
|
|
49
|
-
|
|
50
|
-
# Poll for the report.
|
|
51
|
-
report_data = poll_for_report(report_def_srv, report_definition_id)
|
|
52
|
-
|
|
53
|
-
# Check the response code.
|
|
54
|
-
case report_data[:code]
|
|
55
|
-
when 301
|
|
56
|
-
puts "Acquired report data of size: %d" % report_data[:report_data].size
|
|
57
|
-
when 500
|
|
58
|
-
puts "Received a failure: %s" % report_data[:body]['failureReason']
|
|
59
|
-
if report_data[:body]['failures']
|
|
60
|
-
puts "Failures info:"
|
|
61
|
-
pp report_data[:body]['failures']
|
|
62
|
-
end
|
|
63
|
-
else
|
|
64
|
-
puts "Report returned with unexpected code %d and body: %s" % [
|
|
65
|
-
report_data[:code], report_data[:body]]
|
|
66
|
-
end
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
def poll_for_report(report_def_srv, report_definition_id)
|
|
70
|
-
# Initially run with query_token = 'new'.
|
|
71
|
-
query_token = 'new'
|
|
72
|
-
|
|
73
|
-
MAX_RETRIES.times do |retry_count|
|
|
74
|
-
# Acquire report or report status with "download_mcc_report" extension
|
|
75
|
-
# method.
|
|
76
|
-
report_data = report_def_srv.download_mcc_report(report_definition_id,
|
|
77
|
-
query_token)
|
|
78
|
-
if report_data[:body]
|
|
79
|
-
# Save query id for following queries.
|
|
80
|
-
query_token = report_data[:body]['queryToken']
|
|
81
|
-
# Print current query status.
|
|
82
|
-
puts "Received a status update: %s" % report_data[:body]['state']
|
|
83
|
-
end
|
|
84
|
-
if report_data[:code] == 200
|
|
85
|
-
puts "Try %d/%d: still processing, retry in %d seconds..." % [
|
|
86
|
-
retry_count + 1, MAX_RETRIES, RETRY_INTERVAL]
|
|
87
|
-
sleep(RETRY_INTERVAL)
|
|
88
|
-
else
|
|
89
|
-
return report_data
|
|
90
|
-
end
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
if __FILE__ == $0
|
|
95
|
-
begin
|
|
96
|
-
download_mcc_report()
|
|
97
|
-
|
|
98
|
-
# HTTP errors.
|
|
99
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
100
|
-
puts "HTTP Error: %s" % e
|
|
101
|
-
|
|
102
|
-
# API errors.
|
|
103
|
-
rescue AdwordsApi::Errors::ApiException => e
|
|
104
|
-
puts "Message: %s" % e.message
|
|
105
|
-
puts 'Errors:'
|
|
106
|
-
e.errors.each_with_index do |error, index|
|
|
107
|
-
puts "\tError [%d]:" % (index + 1)
|
|
108
|
-
error.each do |field, value|
|
|
109
|
-
puts "\t\t%s: %s" % [field, value]
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby
|
|
2
|
-
#
|
|
3
|
-
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
|
4
|
-
#
|
|
5
|
-
# Copyright:: Copyright 2010, 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 and saves a report from a report definition using MCC
|
|
21
|
-
# (cross-client) feature to a given path. To create a report definition, run
|
|
22
|
-
# add_mcc_report_definition.rb.
|
|
23
|
-
#
|
|
24
|
-
# Please note: This feature is still under development and may change before it
|
|
25
|
-
# is released.
|
|
26
|
-
#
|
|
27
|
-
# Tags: ReportDefinitionService
|
|
28
|
-
|
|
29
|
-
require 'rubygems'
|
|
30
|
-
require 'adwords_api'
|
|
31
|
-
require 'pp'
|
|
32
|
-
|
|
33
|
-
API_VERSION = :v201101
|
|
34
|
-
MAX_RETRIES = 10
|
|
35
|
-
RETRY_INTERVAL = 30
|
|
36
|
-
|
|
37
|
-
def download_mcc_report_as_file()
|
|
38
|
-
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
|
39
|
-
# when called without parameters.
|
|
40
|
-
adwords = AdwordsApi::Api.new
|
|
41
|
-
|
|
42
|
-
# To enable logging of SOAP requests, set the log_level value to 'DEBUG' in
|
|
43
|
-
# the configuration file or provide your own logger:
|
|
44
|
-
# adwords.logger = Logger.new('adwords_xml.log')
|
|
45
|
-
|
|
46
|
-
report_def_srv = adwords.service(:ReportDefinitionService, API_VERSION)
|
|
47
|
-
|
|
48
|
-
report_definition_id = 'INSERT_REPORT_ID_HERE'.to_i
|
|
49
|
-
file_name = 'INSERT_OUTPUT_FILE_NAME_HERE'
|
|
50
|
-
|
|
51
|
-
# Poll for the report.
|
|
52
|
-
report_data = poll_for_report(report_def_srv, report_definition_id, file_name)
|
|
53
|
-
|
|
54
|
-
# Check the response code.
|
|
55
|
-
case report_data[:code]
|
|
56
|
-
when 301
|
|
57
|
-
puts "Saved report into a file: %s" % file_name
|
|
58
|
-
when 500
|
|
59
|
-
puts "Received a failure: %s" % report_data[:body]['failureReason']
|
|
60
|
-
if report_data[:body]['failures']
|
|
61
|
-
puts "Failures info:"
|
|
62
|
-
pp report_data[:body]['failures']
|
|
63
|
-
end
|
|
64
|
-
else
|
|
65
|
-
puts "Report returned with unexpected code %d and body: %s" % [
|
|
66
|
-
report_data[:code], report_data[:body]]
|
|
67
|
-
end
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
def poll_for_report(report_def_srv, report_definition_id, file_name)
|
|
71
|
-
# Initially run with query_token = 'new'.
|
|
72
|
-
query_token = 'new'
|
|
73
|
-
|
|
74
|
-
MAX_RETRIES.times do |retry_count|
|
|
75
|
-
# Acquire report or report status with "download_mcc_report_as_file"
|
|
76
|
-
# extension method.
|
|
77
|
-
report_data = report_def_srv.download_mcc_report_as_file(
|
|
78
|
-
report_definition_id, query_token, file_name)
|
|
79
|
-
if report_data[:body]
|
|
80
|
-
# Save query id for following queries.
|
|
81
|
-
query_token = report_data[:body]['queryToken']
|
|
82
|
-
# Print current query status.
|
|
83
|
-
puts "Received a status update: %s" % report_data[:body]['state']
|
|
84
|
-
end
|
|
85
|
-
if report_data[:code] == 200
|
|
86
|
-
puts "Try %d/%d: still processing, retry in %d seconds..." % [
|
|
87
|
-
retry_count + 1, MAX_RETRIES, RETRY_INTERVAL]
|
|
88
|
-
sleep(RETRY_INTERVAL)
|
|
89
|
-
else
|
|
90
|
-
return report_data
|
|
91
|
-
end
|
|
92
|
-
end
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
if __FILE__ == $0
|
|
96
|
-
begin
|
|
97
|
-
download_mcc_report_as_file()
|
|
98
|
-
|
|
99
|
-
# HTTP errors.
|
|
100
|
-
rescue AdsCommon::Errors::HttpError => e
|
|
101
|
-
puts "HTTP Error: %s" % e
|
|
102
|
-
|
|
103
|
-
# API errors.
|
|
104
|
-
rescue AdwordsApi::Errors::ApiException => e
|
|
105
|
-
puts "Message: %s" % e.message
|
|
106
|
-
puts 'Errors:'
|
|
107
|
-
e.errors.each_with_index do |error, index|
|
|
108
|
-
puts "\tError [%d]:" % (index + 1)
|
|
109
|
-
error.each do |field, value|
|
|
110
|
-
puts "\t\t%s: %s" % [field, value]
|
|
111
|
-
end
|
|
112
|
-
end
|
|
113
|
-
end
|
|
114
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby
|
|
2
|
-
# This is auto-generated code, changes will be overwritten.
|
|
3
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
|
-
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
|
-
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.0 on 2011-07-19 18:50:04.
|
|
7
|
-
|
|
8
|
-
require 'ads_common/savon_service'
|
|
9
|
-
require 'adwords_api/v13/traffic_estimator_service_registry'
|
|
10
|
-
|
|
11
|
-
module AdwordsApi; module V13; module TrafficEstimatorService
|
|
12
|
-
class TrafficEstimatorService < AdsCommon::SavonService
|
|
13
|
-
def initialize(api, endpoint)
|
|
14
|
-
namespace = 'https://adwords.google.com/api/adwords/v13'
|
|
15
|
-
super(api, endpoint, namespace, :v13)
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def check_keyword_traffic(*args)
|
|
19
|
-
return execute_action('check_keyword_traffic', args)
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def estimate_ad_group_list(*args)
|
|
23
|
-
return execute_action('estimate_ad_group_list', args)
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
def estimate_campaign_list(*args)
|
|
27
|
-
return execute_action('estimate_campaign_list', args)
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def estimate_keyword_list(*args)
|
|
31
|
-
return execute_action('estimate_keyword_list', args)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
|
|
36
|
-
def get_service_registry()
|
|
37
|
-
return TrafficEstimatorServiceRegistry
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
def get_module()
|
|
41
|
-
return AdwordsApi::V13::TrafficEstimatorService
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end; end; end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby
|
|
2
|
-
# This is auto-generated code, changes will be overwritten.
|
|
3
|
-
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
|
4
|
-
# License:: Licensed under the Apache License,Version 2.0 (the "License").
|
|
5
|
-
#
|
|
6
|
-
# Code generated by AdsCommon library 0.5.0 on 2011-07-19 18:50:04.
|
|
7
|
-
|
|
8
|
-
module AdwordsApi; module V13; module TrafficEstimatorService
|
|
9
|
-
class TrafficEstimatorServiceRegistry
|
|
10
|
-
TRAFFICESTIMATORSERVICE_METHODS = {:check_keyword_traffic=>{:input=>[{:type=>"KeywordTrafficRequest", :max_occurs=>:unbounded, :name=>:requests}], :output=>{:fields=>[{:type=>"KeywordTraffic", :max_occurs=>:unbounded, :name=>:check_keyword_traffic_return}], :name=>"check_keyword_traffic_response"}}, :estimate_ad_group_list=>{:input=>[{:type=>"AdGroupRequest", :max_occurs=>:unbounded, :name=>:ad_group_requests}], :output=>{:fields=>[{:type=>"AdGroupEstimate", :max_occurs=>:unbounded, :name=>:estimate_ad_group_list_return}], :name=>"estimate_ad_group_list_response"}}, :estimate_campaign_list=>{:input=>[{:type=>"CampaignRequest", :max_occurs=>:unbounded, :name=>:campaign_requests}], :output=>{:fields=>[{:type=>"CampaignEstimate", :max_occurs=>:unbounded, :name=>:estimate_campaign_list_return}], :name=>"estimate_campaign_list_response"}}, :estimate_keyword_list=>{:input=>[{:type=>"KeywordRequest", :max_occurs=>:unbounded, :name=>:keyword_requests}], :output=>{:fields=>[{:type=>"KeywordEstimate", :max_occurs=>:unbounded, :name=>:estimate_keyword_list_return}], :name=>"estimate_keyword_list_response"}}}
|
|
11
|
-
TRAFFICESTIMATORSERVICE_TYPES = {:MetroTargets=>{:fields=>[{:type=>"string", :max_occurs=>:unbounded, :name=>:excluded_metros, :min_occurs=>0}, {:type=>"string", :max_occurs=>:unbounded, :name=>:metros, :min_occurs=>0}]}, :Circle=>{:fields=>[{:type=>"int", :name=>:latitude_micro_degrees}, {:type=>"int", :name=>:longitude_micro_degrees}, {:type=>"int", :name=>:radius_meters}]}, :ProximityTargets=>{:fields=>[{:type=>"Circle", :max_occurs=>:unbounded, :name=>:circles}]}, :NetworkTarget=>{:fields=>[{:type=>"NetworkType", :max_occurs=>:unbounded, :name=>:network_types, :min_occurs=>0}]}, :AdGroupEstimate=>{:fields=>[{:type=>"int", :name=>:id, :min_occurs=>0}, {:type=>"KeywordEstimate", :max_occurs=>:unbounded, :name=>:keyword_estimates}]}, :KeywordEstimate=>{:fields=>[{:type=>"long", :name=>:id, :min_occurs=>0}, {:type=>"float", :name=>:lower_avg_position}, {:type=>"float", :name=>:lower_clicks_per_day}, {:type=>"long", :name=>:lower_cpc}, {:type=>"float", :name=>:upper_avg_position}, {:type=>"float", :name=>:upper_clicks_per_day}, {:type=>"long", :name=>:upper_cpc}]}, :CityTargets=>{:fields=>[{:type=>"string", :max_occurs=>:unbounded, :name=>:cities, :min_occurs=>0}, {:type=>"string", :max_occurs=>:unbounded, :name=>:excluded_cities, :min_occurs=>0}]}, :RegionTargets=>{:fields=>[{:type=>"string", :max_occurs=>:unbounded, :name=>:excluded_regions, :min_occurs=>0}, {:type=>"string", :max_occurs=>:unbounded, :name=>:regions, :min_occurs=>0}]}, :GeoTarget=>{:fields=>[{:type=>"CityTargets", :name=>:city_targets, :min_occurs=>0}, {:type=>"CountryTargets", :name=>:country_targets, :min_occurs=>0}, {:type=>"MetroTargets", :name=>:metro_targets, :min_occurs=>0}, {:type=>"ProximityTargets", :name=>:proximity_targets, :min_occurs=>0}, {:type=>"RegionTargets", :name=>:region_targets, :min_occurs=>0}, {:type=>"boolean", :name=>:target_all}]}, :CountryTargets=>{:fields=>[{:type=>"string", :max_occurs=>:unbounded, :name=>:countries, :min_occurs=>0}, {:type=>"string", :max_occurs=>:unbounded, :name=>:excluded_countries, :min_occurs=>0}]}, :LanguageTarget=>{:fields=>[{:type=>"string", :max_occurs=>:unbounded, :name=>:languages}]}, :CampaignEstimate=>{:fields=>[{:type=>"AdGroupEstimate", :max_occurs=>:unbounded, :name=>:ad_group_estimates}, {:type=>"int", :name=>:id, :min_occurs=>0}]}, :KeywordRequest=>{:fields=>[{:type=>"long", :name=>:id, :min_occurs=>0}, {:type=>"long", :name=>:max_cpc, :min_occurs=>0}, {:type=>"boolean", :name=>:negative, :min_occurs=>0}, {:type=>"string", :name=>:text, :min_occurs=>0}, {:type=>"KeywordType", :name=>:type, :min_occurs=>0}]}, :AdGroupRequest=>{:fields=>[{:type=>"long", :name=>:id, :min_occurs=>0}, {:type=>"KeywordRequest", :max_occurs=>:unbounded, :name=>:keyword_requests}, {:type=>"long", :name=>:max_cpc, :min_occurs=>0}]}, :KeywordTrafficRequest=>{:fields=>[{:type=>"string", :name=>:keyword_text}, {:type=>"KeywordType", :name=>:keyword_type}, {:type=>"string", :name=>:language, :min_occurs=>0}]}, :CampaignRequest=>{:fields=>[{:type=>"AdGroupRequest", :max_occurs=>:unbounded, :name=>:ad_group_requests}, {:type=>"GeoTarget", :name=>:geo_targeting, :min_occurs=>0}, {:type=>"int", :name=>:id, :min_occurs=>0}, {:type=>"LanguageTarget", :name=>:language_targeting, :min_occurs=>0}, {:type=>"NetworkTarget", :name=>:network_targeting, :min_occurs=>0}]}}
|
|
12
|
-
TRAFFICESTIMATORSERVICE_NAMESPACES = []
|
|
13
|
-
|
|
14
|
-
def self.get_method_signature(method_name)
|
|
15
|
-
return TRAFFICESTIMATORSERVICE_METHODS[method_name.to_sym]
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
def self.get_type_signature(type_name)
|
|
19
|
-
return TRAFFICESTIMATORSERVICE_TYPES[type_name.to_sym]
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
def self.get_namespace(index)
|
|
23
|
-
return TRAFFICESTIMATORSERVICE_NAMESPACES[index]
|
|
24
|
-
end
|
|
25
|
-
end
|
|
26
|
-
|
|
27
|
-
class ApiException < AdwordsApi::Errors::ApiException
|
|
28
|
-
attr_reader :code # int
|
|
29
|
-
attr_reader :errors # ApiError
|
|
30
|
-
attr_reader :internal # boolean
|
|
31
|
-
attr_reader :message # string
|
|
32
|
-
attr_reader :trigger # string
|
|
33
|
-
def initialize(exception_fault)
|
|
34
|
-
@array_fields ||= []
|
|
35
|
-
@array_fields << 'errors'
|
|
36
|
-
super(exception_fault)
|
|
37
|
-
end
|
|
38
|
-
end
|
|
39
|
-
end; end; end
|