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
data/ChangeLog
CHANGED
data/README
CHANGED
@@ -6,9 +6,9 @@ AdWords and DoubleClick Ad Exchange Buyer API!
|
|
6
6
|
Please note that this is an early PREVIEW of the client library, still under
|
7
7
|
development.
|
8
8
|
|
9
|
-
It contains full support for
|
10
|
-
|
11
|
-
|
9
|
+
It contains full support for v201109, with full stubs, and a simplified
|
10
|
+
programming interface that lets you handle everything in native Ruby
|
11
|
+
collections.
|
12
12
|
|
13
13
|
|
14
14
|
= Docs for Users
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
# Encoding: utf-8
|
2
2
|
#
|
3
3
|
# Authors:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
4
|
#
|
5
|
-
# Copyright:: Copyright
|
5
|
+
# Copyright:: Copyright 2012, Google Inc. All Rights Reserved.
|
6
6
|
#
|
7
7
|
# License:: Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
# you may not use this file except in compliance with the License.
|
@@ -26,7 +26,7 @@ require './lib/adwords_api/api_config'
|
|
26
26
|
require './lib/adwords_api/extensions'
|
27
27
|
|
28
28
|
# Workaround for the current mess of different yamlers in Ruby world.
|
29
|
-
if RUBY_VERSION>='1.9.2'
|
29
|
+
if RUBY_VERSION >= '1.9.2' and RUBY_ENGINE == 'ruby'
|
30
30
|
gem 'psych'
|
31
31
|
YAML::ENGINE.yamler = 'psych'
|
32
32
|
end
|
@@ -1,6 +1,7 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: utf-8
|
2
3
|
#
|
3
|
-
# Author:: api.
|
4
|
+
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
5
|
#
|
5
6
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
7
|
#
|
@@ -17,8 +18,8 @@
|
|
17
18
|
# See the License for the specific language governing permissions and
|
18
19
|
# limitations under the License.
|
19
20
|
#
|
20
|
-
# This
|
21
|
-
#
|
21
|
+
# This example gets all alerts for all clients of an MCC account. The effective
|
22
|
+
# user (clientCustomerId, or authToken) must be an MCC user to get results.
|
22
23
|
#
|
23
24
|
# Tags: AlertService.get
|
24
25
|
|
@@ -27,8 +28,9 @@ require 'adwords_api'
|
|
27
28
|
require 'adwords_api/utils'
|
28
29
|
|
29
30
|
API_VERSION = :v201109
|
31
|
+
PAGE_SIZE = 500
|
30
32
|
|
31
|
-
def
|
33
|
+
def get_account_alerts()
|
32
34
|
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
33
35
|
# when called without parameters.
|
34
36
|
adwords = AdwordsApi::Api.new
|
@@ -46,36 +48,51 @@ def get_campaign_alerts()
|
|
46
48
|
:client_spec => 'ALL',
|
47
49
|
:trigger_time_spec => 'ALL_TIME',
|
48
50
|
:severities => ['GREEN', 'YELLOW', 'RED'],
|
49
|
-
:types => [
|
51
|
+
:types => [
|
52
|
+
'ACCOUNT_BUDGET_BURN_RATE', 'ACCOUNT_BUDGET_ENDING',
|
53
|
+
'ACCOUNT_ON_TARGET', 'CAMPAIGN_ENDED', 'CAMPAIGN_ENDING',
|
54
|
+
'CREDIT_CARD_EXPIRING', 'DECLINED_PAYMENT', 'MANAGER_LINK_PENDING',
|
55
|
+
'MISSING_BANK_REFERENCE_NUMBER', 'PAYMENT_NOT_ENTERED',
|
56
|
+
'TV_ACCOUNT_BUDGET_ENDING', 'TV_ACCOUNT_ON_TARGET',
|
57
|
+
'TV_ZERO_DAILY_SPENDING_LIMIT', 'USER_INVITE_ACCEPTED',
|
58
|
+
'USER_INVITE_PENDING', 'ZERO_DAILY_SPENDING_LIMIT'
|
59
|
+
]
|
50
60
|
},
|
51
61
|
:paging => {
|
52
62
|
:start_index => 0,
|
53
|
-
:number_results =>
|
63
|
+
:number_results => PAGE_SIZE
|
54
64
|
}
|
55
65
|
}
|
56
66
|
|
57
|
-
#
|
58
|
-
|
67
|
+
# Set initial values.
|
68
|
+
offset, page = 0, {}
|
59
69
|
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
70
|
+
# Get alerts.
|
71
|
+
begin
|
72
|
+
page = alert_srv.get(selector)
|
73
|
+
if page[:entries]
|
74
|
+
page[:entries].each_with_index do |alert, index|
|
75
|
+
puts "%d) Customer ID is '%s', alert type is '%s', severity is '%s'."
|
76
|
+
[AdwordsApi::Utils.format_id(alert[:client_customer_id]),
|
77
|
+
alert[:alert_type], alert[:alert_severity]]
|
78
|
+
alert[:details].each do |detail|
|
79
|
+
puts "\t- triggered at %s" % detail[:trigger_time]
|
80
|
+
end
|
69
81
|
end
|
82
|
+
# Increment values to request the next page.
|
83
|
+
offset += PAGE_SIZE
|
84
|
+
selector[:paging][:start_index] = offset
|
70
85
|
end
|
71
|
-
|
72
|
-
|
86
|
+
end while page[:total_num_entries] > offset
|
87
|
+
|
88
|
+
if page.include?(:total_num_entries)
|
89
|
+
puts "\tTotal number of alerts: %d." % page[:total_num_entries]
|
73
90
|
end
|
74
91
|
end
|
75
92
|
|
76
93
|
if __FILE__ == $0
|
77
94
|
begin
|
78
|
-
|
95
|
+
get_account_alerts()
|
79
96
|
|
80
97
|
# HTTP errors.
|
81
98
|
rescue AdsCommon::Errors::HttpError => e
|
data/examples/v201109/{get_all_account_changes.rb → account_management/get_account_changes.rb}
RENAMED
@@ -1,6 +1,7 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: utf-8
|
2
3
|
#
|
3
|
-
# Author:: api.
|
4
|
+
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
5
|
#
|
5
6
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
7
|
#
|
@@ -17,18 +18,19 @@
|
|
17
18
|
# See the License for the specific language governing permissions and
|
18
19
|
# limitations under the License.
|
19
20
|
#
|
20
|
-
# This example gets all account changes
|
21
|
-
# all campaigns.
|
21
|
+
# This example gets all account changes that happened within the last 24 hours,
|
22
|
+
# for all your campaigns.
|
22
23
|
#
|
23
24
|
# Tags: CustomerSyncService.get
|
24
25
|
|
25
26
|
require 'rubygems'
|
26
27
|
require 'adwords_api'
|
28
|
+
require 'date'
|
27
29
|
require 'pp'
|
28
30
|
|
29
31
|
API_VERSION = :v201109
|
30
32
|
|
31
|
-
def
|
33
|
+
def get_account_changes()
|
32
34
|
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
33
35
|
# when called without parameters.
|
34
36
|
adwords = AdwordsApi::Api.new
|
@@ -54,14 +56,12 @@ def get_all_account_changes()
|
|
54
56
|
campaign_ids = []
|
55
57
|
|
56
58
|
if response and response[:entries]
|
57
|
-
|
58
|
-
campaign_ids = campaigns.map { |campaign| campaign[:id] }
|
59
|
+
campaign_ids = response[:entries].map { |campaign| campaign[:id] }
|
59
60
|
else
|
60
|
-
|
61
|
-
return
|
61
|
+
raise StandardError, 'No campaigns were found.'
|
62
62
|
end
|
63
63
|
|
64
|
-
# Create selector for CustomerSyncService.
|
64
|
+
# Create a selector for CustomerSyncService.
|
65
65
|
selector = {
|
66
66
|
:campaign_ids => campaign_ids,
|
67
67
|
:date_time_range => {
|
@@ -70,54 +70,55 @@ def get_all_account_changes()
|
|
70
70
|
}
|
71
71
|
}
|
72
72
|
|
73
|
-
# Get all account changes for campaigns.
|
73
|
+
# Get all account changes for the campaigns.
|
74
74
|
campaign_changes = customer_sync_srv.get(selector)
|
75
75
|
|
76
76
|
# Display changes.
|
77
77
|
if campaign_changes
|
78
|
-
puts "Most recent change:
|
78
|
+
puts "Most recent change: %s" % campaign_changes[:last_change_timestamp]
|
79
79
|
campaign_changes[:changed_campaigns].each do |campaign|
|
80
|
-
puts "Campaign with
|
81
|
-
puts "
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
80
|
+
puts "Campaign with ID %d was changed:" % campaign[:campaign_id]
|
81
|
+
puts "\tCampaign change status: '%s'" % campaign[:campaign_change_status]
|
82
|
+
unless ['NEW', 'FIELDS_UNCHANGED'].include?(
|
83
|
+
campaign[:campaign_change_status])
|
84
|
+
puts "\tAdded ad extensions: '%s'" %
|
85
|
+
campaign[:added_ad_extensions].pretty_inspect.chomp
|
86
|
+
puts "\tAdded campaign criteria: '%s'" %
|
87
|
+
campaign[:added_campaign_criteria].pretty_inspect.chomp
|
88
|
+
puts "\tAdded campaign targeting: '%s'" %
|
89
|
+
campaign[:campaign_targeting_changed].pretty_inspect.chomp
|
90
|
+
puts "\tDeleted ad extensions: '%s'" %
|
91
|
+
campaign[:deleted_ad_extensions].pretty_inspect.chomp
|
92
|
+
puts "\tDeleted campaign criteria: '%s'" %
|
93
|
+
campaign[:deleted_campaign_criteria].pretty_inspect.chomp
|
93
94
|
|
94
95
|
if campaign[:changed_ad_groups]
|
95
96
|
campaign[:changed_ad_groups].each do |ad_group|
|
96
|
-
puts "
|
97
|
-
puts "
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
puts "
|
102
|
-
ad_group[:
|
103
|
-
puts "
|
104
|
-
ad_group[:
|
97
|
+
puts "\tAd group with ID %d was changed:" % ad_group[:ad_group_id]
|
98
|
+
puts "\t\tAd group changed status: '%s'" %
|
99
|
+
ad_group[:ad_group_change_status]
|
100
|
+
unless ['NEW', 'FIELDS_UNCHANGED'].include?(
|
101
|
+
ad_group[:ad_group_change_status])
|
102
|
+
puts "\t\tAds changed: '%s'" %
|
103
|
+
ad_group[:changed_ads].pretty_inspect.chomp
|
104
|
+
puts "\t\tCriteria changed: '%s'" %
|
105
|
+
ad_group[:changed_criteria].pretty_inspect.chomp
|
106
|
+
puts "\t\tCriteria deleted: '%s'" %
|
107
|
+
ad_group[:deleted_criteria].pretty_inspect.chomp
|
105
108
|
end
|
106
109
|
end
|
107
110
|
end
|
108
111
|
end
|
109
|
-
puts
|
112
|
+
puts
|
110
113
|
end
|
111
114
|
else
|
112
|
-
puts
|
115
|
+
puts 'No account changes were found.'
|
113
116
|
end
|
114
|
-
|
115
|
-
|
116
117
|
end
|
117
118
|
|
118
119
|
if __FILE__ == $0
|
119
120
|
begin
|
120
|
-
|
121
|
+
get_account_changes()
|
121
122
|
|
122
123
|
# HTTP errors.
|
123
124
|
rescue AdsCommon::Errors::HttpError => e
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: utf-8
|
2
3
|
#
|
3
4
|
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
5
|
#
|
@@ -17,8 +18,8 @@
|
|
17
18
|
# See the License for the specific language governing permissions and
|
18
19
|
# limitations under the License.
|
19
20
|
#
|
20
|
-
# This example illustrates how to retrieve the number of API units
|
21
|
-
#
|
21
|
+
# This example illustrates how to retrieve the number of API units usage for a
|
22
|
+
# client account for the current month.
|
22
23
|
#
|
23
24
|
# Tags: InfoService.get
|
24
25
|
|
@@ -27,7 +28,7 @@ require 'adwords_api'
|
|
27
28
|
|
28
29
|
API_VERSION = :v201109
|
29
30
|
|
30
|
-
def
|
31
|
+
def get_client_unit_usage()
|
31
32
|
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
32
33
|
# when called without parameters.
|
33
34
|
adwords = AdwordsApi::Api.new
|
@@ -38,19 +39,26 @@ def get_unit_count()
|
|
38
39
|
|
39
40
|
info_srv = adwords.service(:InfoService, API_VERSION)
|
40
41
|
|
42
|
+
# Specify client customer ID for the account to get usage for.
|
43
|
+
client_customer_id = 'INSERT_CLIENT_CUSTOMER_ID_HERE'.to_i
|
44
|
+
|
41
45
|
start_date = Time.now.strftime('%Y%m01')
|
42
46
|
end_date = Time.now.strftime('%Y%m%d')
|
43
47
|
|
44
48
|
selector = {
|
45
|
-
:api_usage_type => '
|
49
|
+
:api_usage_type => 'UNIT_COUNT_FOR_CLIENTS',
|
50
|
+
:client_customer_ids => [client_customer_id],
|
51
|
+
# Set to true to navigate your entire accounts tree.
|
52
|
+
:include_sub_accounts => 1,
|
46
53
|
:date_range => {
|
47
54
|
:min => start_date,
|
48
55
|
:max => end_date
|
49
56
|
}
|
50
57
|
}
|
51
58
|
|
52
|
-
#
|
59
|
+
# Force to use the MCC credentials.
|
53
60
|
adwords.use_mcc do
|
61
|
+
# Get the unit info.
|
54
62
|
info_srv.get(selector) do |header, response|
|
55
63
|
puts "Total number of units consumed from %s to %s is %d." %
|
56
64
|
[start_date, end_date, response[:cost]]
|
@@ -61,7 +69,7 @@ end
|
|
61
69
|
|
62
70
|
if __FILE__ == $0
|
63
71
|
begin
|
64
|
-
|
72
|
+
get_client_unit_usage()
|
65
73
|
|
66
74
|
# HTTP errors.
|
67
75
|
rescue AdsCommon::Errors::HttpError => e
|
@@ -1,6 +1,7 @@
|
|
1
|
-
#!/usr/bin/ruby
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# Encoding: utf-8
|
2
3
|
#
|
3
|
-
# Author:: api.
|
4
|
+
# Author:: api.dklimkin@gmail.com (Danial Klimkin)
|
4
5
|
#
|
5
6
|
# Copyright:: Copyright 2011, Google Inc. All Rights Reserved.
|
6
7
|
#
|
@@ -17,8 +18,8 @@
|
|
17
18
|
# See the License for the specific language governing permissions and
|
18
19
|
# limitations under the License.
|
19
20
|
#
|
20
|
-
# This example illustrates how to add
|
21
|
-
# an ad group, run add_ad_group.rb.
|
21
|
+
# This example illustrates how to add multiple keywords to a given ad group. To
|
22
|
+
# create an ad group, run add_ad_group.rb.
|
22
23
|
#
|
23
24
|
# Tags: AdGroupCriterionService.mutate
|
24
25
|
|
@@ -27,7 +28,7 @@ require 'adwords_api'
|
|
27
28
|
|
28
29
|
API_VERSION = :v201109
|
29
30
|
|
30
|
-
def
|
31
|
+
def add_keywords()
|
31
32
|
# AdwordsApi::Api will read a config file from ENV['HOME']/adwords_api.yml
|
32
33
|
# when called without parameters.
|
33
34
|
adwords = AdwordsApi::Api.new
|
@@ -41,42 +42,36 @@ def add_ad_group_criteria()
|
|
41
42
|
|
42
43
|
ad_group_id = 'INSERT_AD_GROUP_ID_HERE'.to_i
|
43
44
|
|
44
|
-
# Create
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
45
|
+
# Create keywords.
|
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
|
+
keywords = [
|
50
|
+
{:xsi_type => 'BiddableAdGroupCriterion',
|
51
|
+
:ad_group_id => ad_group_id,
|
52
|
+
:criterion => {
|
53
|
+
:xsi_type => 'Keyword',
|
54
|
+
:text => 'mars cruise',
|
55
|
+
:match_type => 'BROAD'}},
|
56
|
+
{:xsi_type => 'BiddableAdGroupCriterion',
|
57
|
+
:ad_group_id => ad_group_id,
|
58
|
+
:criterion => {
|
59
|
+
:xsi_type => 'Keyword',
|
60
|
+
:text => 'space hotel',
|
61
|
+
:match_type => 'BROAD'}}
|
62
|
+
]
|
60
63
|
|
61
|
-
# Create
|
62
|
-
|
63
|
-
:operator => 'ADD',
|
64
|
-
|
65
|
-
:xsi_type => 'BiddableAdGroupCriterion',
|
66
|
-
:ad_group_id => ad_group_id,
|
67
|
-
:criterion => {
|
68
|
-
:xsi_type => 'Placement',
|
69
|
-
:url => 'http://mars.google.com'
|
70
|
-
}
|
71
|
-
}
|
72
|
-
}
|
64
|
+
# Create 'ADD' operations.
|
65
|
+
operations = keywords.map do |keyword|
|
66
|
+
{:operator => 'ADD', :operand => keyword}
|
67
|
+
end
|
73
68
|
|
74
69
|
# Add criteria.
|
75
|
-
response = ad_group_criterion_srv.mutate(
|
70
|
+
response = ad_group_criterion_srv.mutate(operations)
|
76
71
|
if response and response[:value]
|
77
72
|
ad_group_criteria = response[:value]
|
78
|
-
puts "Added %d criteria to ad group %d" %
|
79
|
-
ad_group_id]
|
73
|
+
puts "Added %d criteria to ad group ID %d:" %
|
74
|
+
[ad_group_criteria.length, ad_group_id]
|
80
75
|
ad_group_criteria.each do |ad_group_criterion|
|
81
76
|
puts "\tCriterion ID is %d and type is '%s'" %
|
82
77
|
[ad_group_criterion[:criterion][:id],
|
@@ -89,7 +84,7 @@ end
|
|
89
84
|
|
90
85
|
if __FILE__ == $0
|
91
86
|
begin
|
92
|
-
|
87
|
+
add_keywords()
|
93
88
|
|
94
89
|
# HTTP errors.
|
95
90
|
rescue AdsCommon::Errors::HttpError => e
|