Giter Site home page Giter Site logo

google-ads-perl's People

Contributors

abhinickz avatar anashoommen avatar andrewmburke avatar danielfrg avatar jradcliff avatar laurachevalier4 avatar pierrickvoulet avatar sundquist avatar szabgab avatar wayneluzw avatar wfansh avatar yangda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-ads-perl's Issues

update_keyword.pl mutate issue

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

Examples for adding/removing blocked IP addresses in the campaign

Problem you are trying to solve:

  • Add/remove excluded IP addresses in the campaign.
    image

Solution you'd like:

  • Examples for adding/removing blocked IP addresses in the campaign.

Alternatives you've considered:

  • Checked the library/API for any help related to this issue.

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.

Adding GitHub Actions

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?

Minimum Perl Version

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.

Default branch is now `main`

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.

Rename some code samples.

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

[Automation] 4. Github Issue Templates

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).

Remove membership_life_span line from add_flexible_rule_user_list example

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.