googleads / google-ads-perl Goto Github PK
View Code? Open in Web Editor NEWGoogle Ads API Client Library for Perl
License: Apache License 2.0
Google Ads API Client Library for Perl
License: Apache License 2.0
Send reminders about internally mirrored client library repo bugs to improve our ability to meet SLAs.
Google::Ads::GoogleAds::Client V6
Perl 5.26.1
Ubuntu 14.04.5 LTS
Actions taken
I am trying to update a keyword using the example given (google-ads-perl/examples/basic_operations/update_keyword.pl) and I just want to change it's status from ENABLED to PAUSED.
The update seems to be working fine as the specific keyword is getting PAUSED but the problem is that the $ad_group_criteria_response variable is undef and the script exits printing the following without printing anything else. So I am guessing that the mutate function has failed but didn't produce any errors. Is that right?
Actual result
{
"results": [
{
"resourceName": "customers/1111111111/adGroupCriteria/22222222222~333333333333"
}
]
}
instead of printing this
Expected result
Updated keyword criterion with resource name: 'customers/1111111111/adGroupCriteria/22222222222~333333333333'
Actual Script
#!/usr/bin/perl -w
use strict;
use warnings;
use utf8;
use FindBin qw($Bin);
use lib "$Bin/../../lib";
use Google::Ads::GoogleAds::Client;
use Google::Ads::GoogleAds::Utils::GoogleAdsHelper;
use Google::Ads::GoogleAds::Utils::FieldMasks;
use Google::Ads::GoogleAds::V6::Resources::AdGroupCriterion;
use Google::Ads::GoogleAds::V6::Enums::AdGroupCriterionStatusEnum qw(ENABLED PAUSED);
use Google::Ads::GoogleAds::V6::Services::AdGroupCriterionService::AdGroupCriterionOperation;
use Google::Ads::GoogleAds::V6::Utils::ResourceNames;
use Getopt::Long qw(:config auto_help);
use Pod::Usage;
use Cwd qw(abs_path);
my $customer_id = "111-111-1111";
my $ad_group_id = "22222222222";
my $criterion_id = "333333333333";
sub update_keyword {
my ( $api_client, $customer_id, $ad_group_id, $criterion_id ) = @_;
my $ad_group_criterion = Google::Ads::GoogleAds::V6::Resources::AdGroupCriterion->new(
{
resourceName => Google::Ads::GoogleAds::V6::Utils::ResourceNames::ad_group_criterion(
$customer_id, $ad_group_id, $criterion_id
),
status => PAUSED,
}
);
my $ad_group_criterion_operation
= Google::Ads::GoogleAds::V6::Services::AdGroupCriterionService::AdGroupCriterionOperation
->new(
{
update => $ad_group_criterion,
updateMask => all_set_fields_of($ad_group_criterion)
}
);
my $ad_group_criteria_response = $api_client->AdGroupCriterionService()->mutate(
{
customerId => $customer_id,
operations => [$ad_group_criterion_operation]
}
);
printf "Updated keyword criterion with resource name: '%s'.\n",
$ad_group_criteria_response->{results}[0]{resourceName};
return 1;
}
if ( abs_path($0) ne abs_path(__FILE__) ) {
return 1;
}
my $api_client = Google::Ads::GoogleAds::Client->new();
$api_client->set_die_on_faults(1);
GetOptions(
"customer_id=s" => \$customer_id,
"ad_group_id=i" => \$ad_group_id,
"criterion_id=i" => \$criterion_id
);
pod2usage(2) if not check_params( $customer_id, $ad_group_id, $criterion_id );
update_keyword(
$api_client, $customer_id =~ s/-//gr,
$ad_group_id, $criterion_id
);
=pod
=head1 NAME
update_keyword
=head1 DESCRIPTION
This example updates a keyword in an ad group. To get keywords, run get_keywords.pl.
=head1 SYNOPSIS
update_keyword.pl [options]
-help Show the help message.
-customer_id The Google Ads customer ID.
-ad_group_id The ad group ID.
-criterion_id The criterion ID, aka the keyword ID.
=cut
Problem you are trying to solve:
Solution you'd like:
Alternatives you've considered:
Additional context:
Not sure about the contribution to this So I created this issue.
Please let me know if I can add the PR for this.
I am using the CPAN Digger to monitor recently uploaded Perl modules that don't have a CI system. This project does not seem to have one.
Would you be interested in a pull-request adding GitHub Actions?
Automatically assign team members to Pull Requests and require that at least one code owner approves.
Automatically delete branches after merge to maintain repository cleanliness and avoid branches that were leftover “just in case”.
Hello, I recently tried to install the latest version of GoogleAds for Perl and it's showing that the minimum perl version is 5.32.1. On Ubuntu, the latest version of perl is 5.30. Furthermore, as per Google Ads API page, the minimum requirement is supposed to be 5.24.1 or greater. This minimum requirement change to 5.32.1 is not possible on Ubuntu. Please advise.
The generate_user_credentials
example is calling issue_access_token
, which uses a default redirect_uri that's part of the OOB flow, which is soon to be deprecated. We should update this default value to localhost
so that users running this example do not run into errors related to the deprecated flow.
The Annual Google Ads (AdWords) API Developer Survey for 2021 is closing on December 31st. Please take 10-15 minutes to share your feedback with us before the end of the month.
Here is our original blog post for reference.
As part of Google’s ongoing efforts to foster inclusive language, we’ve changed the default branch of this project to main
. We encourage contributors to do the same for their forks and local development environments in order to minimize issues when creating pull requests.
Which version of the client library are you using?
v3_0
Which version of Perl are you using?
5.30.0
Which operating system (Linux, Windows, ...) and version?
Linux
Actions taken
Please provide a code snippet or steps to consistently reproduce the experienced behavior.
[DO NOT INCLUDE ANY PERSONAL OR SENSITIVE DATA IN YOUR SUBMITTED CODE]
Rename code samples:
remove_feed_item_attribute_value.pl -> remove_flights_feed_item_string_attribute_value.pl
update_feed_item_attribute_value.pl -> update_flights_feed_item_string_attribute_value.pl
Expected result
Actual result
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
See troubleshooting for how to diagnose problems better.
Anything else we should know about your project / environment
Encourage users to submit all of the information that will be useful for us to scope and fix bugs, or submit feature requests. Also, clarify what the intention of these issues is, and point users in the right direction if their intent is not aligned (e.g. for general API-related issues).
membership_life_span
cannot be set for FlexibleRuleUserList
. We should update the add_flexible_rule_user_list
example to remove the line that sets this to 365, as this value is ignored for this type of user list. This value is set to a default value of 540 for FlexibleRuleUserList
regardless of user-provided value. This is a special case that doesn't apply to other list types, so no need to update other examples.
"Request contains an invalid argument."
error is coming from CampaignBudget bug in v13.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.