Re: error when creating new ad schedule (campaign criterion)

2020-12-10 Thread fru...@adzlocal.de
hey, just made another attempt to update to api v5 but with an updated 
protobuf library (v3.14.0) which in the meantime has been updated due to a 
known issue - now it works as expected
so if someone stumbles upon a similar problem please check/update your 
library versions..

adsapiforumadvisor schrieb am Donnerstag, 8. Oktober 2020 um 21:47:24 UTC+2:

> Hello,
>
> Can you please *reply privately to author *your request and response for 
> this API call so that we can take a closer look?
>
>
> Thanks,
> Anthony
> Google Ads API Team
>
> [image: Google Logo] 
> Anthony 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q25Yela:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ca7d5590-d50c-4eea-9b30-0eb10e2ca7b0n%40googlegroups.com.


RE: error when creating new ad schedule (campaign criterion)

2020-10-08 Thread Google Ads API Forum Advisor Prod
Hello,

Can you please reply privately to author your request and response for this API 
call so that we can take a closer look?

Thanks,
Anthony
Google Ads API Team

Anthony
Google Ads API Team
ref:_00D1U1174p._5004Q25Yela:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/XPzHb0QHWEY300HxInR-S_StOt255oqD0I2A%40sfdc.net.


Re: error when creating new ad schedule (campaign criterion)

2020-10-08 Thread goo...@spammerz.de
Hey there, I seem to have a similar error when trying to create an 
ExpandedTextAd. Getting the message that 'Field 'ad_group' is required for 
'CREATE' operation'.

Similar to the example above I do provide resource name and everything 
required. Google Ads V4 does not complain about this. Using batch jobs to 
create the ads.

On Friday, October 2, 2020 at 2:10:27 PM UTC+2 fru...@adzlocal.de wrote:

> Hi there,
>
> i'm trying to create a set of adgroup criteria for a campaign (ad 
> schedules) with the new php v5 library.
> But all i get is an error message saying that the field 'campaign' is 
> missing.
> This is the debug log output:
>
>
> [2020-10-02 13:41:06] google-ads.WARNING: Request made: Host: "
> googleads.googleapis.com", Method: 
> "/google.ads.googleads.v5.services.CampaignCriterionService/MutateCampaignCriteria",
>  
> CustomerId: 9060438356, RequestId: "IM6lns_YYYaajRQPX6ocGA", IsFault: 1, 
> FaultMessage: "["Field 'campaign' is required for 'CREATE' 
> operation.","Field 'campaign' is required for 'CREATE' operation.","Field 
> 'campaign' is required for 'CREATE' operation.","Field 'campaign' is 
> required for 'CREATE' operation.","Field 'campaign' is required for 
> 'CREATE' operation."]"  
> [2020-10-02 13:41:06] google-ads.NOTICE: Request
> ---
> Method Name: 
> /google.ads.googleads.v5.services.CampaignCriterionService/MutateCampaignCriteria
> Host: googleads.googleapis.com
> Headers: {
> "x-goog-api-client": "gl-php\/7.3.18 gapic\/ gax\/1.4.0 grpc\/1.29.1",
> "x-goog-request-params": "customer_id=9060438356",
> "developer-token": "REDACTED",
> "login-customer-id": "3478781078 <(347)%20878-1078>"
> }
> Request: 
> {"customerId":"9060438356","operations":[{"create":{"adSchedule":{"startMinute":"ZERO","endMinute":"ZERO","dayOfWeek":"MONDAY"}}},{"create":{"adSchedule":{"startMinute":"ZERO","endMinute":"ZERO","dayOfWeek":"TUESDAY"}}},{"create":{"adSchedule":{"startMinute":"ZERO","endMinute":"ZERO","dayOfWeek":"WEDNESDAY"}}},{"create":{"adSchedule":{"startMinute":"ZERO","endMinute":"ZERO","dayOfWeek":"THURSDAY"}}},{"create":{"adSchedule":{"startMinute":"ZERO","endMinute":"ZERO","dayOfWeek":"FRIDAY"}}}]}
>
> Response
> ---
> Headers: {
> "request-id": "IM6lns_YYYaajRQPX6ocGA",
> "date": "Fri, 02 Oct 2020 11:41:05 GMT",
> "alt-svc": "h3-Q050=\":443\"; ma=2592000,h3-29=\":443\"; 
> ma=2592000,h3-27=\":443\"; ma=2592000,h3-T051=\":443\"; 
> ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\"; 
> ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; 
> v=\"46,43\""
> }
>
> Fault
> ---
> Status code: 3
> Details: Request contains an invalid argument.
> Failure: 
> {"errors":[{"errorCode":{"requestError":"REQUIRED_FIELD_MISSING"},"message":"Field
>  
> 'campaign' is required for 'CREATE' 
> operation.","location":{"fieldPathElements":[{"fieldName":"operations","index":"0"},{"fieldName":"create"},{"fieldName":"campaign"}]}},{"errorCode":{"requestError":"REQUIRED_FIELD_MISSING"},"message":"Field
>  
> 'campaign' is required for 'CREATE' 
> operation.","location":{"fieldPathElements":[{"fieldName":"operations","index":"1"},{"fieldName":"create"},{"fieldName":"campaign"}]}},{"errorCode":{"requestError":"REQUIRED_FIELD_MISSING"},"message":"Field
>  
> 'campaign' is required for 'CREATE' 
> operation.","location":{"fieldPathElements":[{"fieldName":"operations","index":"2"},{"fieldName":"create"},{"fieldName":"campaign"}]}},{"errorCode":{"requestError":"REQUIRED_FIELD_MISSING"},"message":"Field
>  
> 'campaign' is required for 'CREATE' 
> operation.","location":{"fieldPathElements":[{"fieldName":"operations","index":"3"},{"fieldName":"create"},{"fieldName":"campaign"}]}},{"errorCode":{"requestError":"REQUIRED_FIELD_MISSING"},"message":"Field
>  
> 'campaign' is required for 'CREATE' 
> operation.","location":{"fieldPathElements":[{"fieldName":"operations","index":"4"},{"fieldName":"create"},{"fieldName":"campaign"}]}}]}
>   
>
>
>
>
> I can see that the request seems to be missing the campaign field, but i 
> think the campaign has been set for each new campaign criterion.
> This is my code:
>
> 
> $campaignResourceName = ResourceNames::forCampaign($accountId, 
> $campaignId);
> $operations = [];
> foreach ($adScheduleInfos as $adScheduleInfo) {
> $campaignCriterion = new CampaignCriterion(
> [
> 'ad_schedule' => $adScheduleInfo,
> 'campaign' => $campaignResourceName
> ]
> );
> $operations[] = new CampaignCriterionOperation(['create' => 
> $campaignCriterion]);
> }
>
> foreach ($operations as $op) {
> var_dump($op->getCreate()->getCampaign());
> }
>
> $response = 
> $googleAdsClient->getCampaignCriterionServiceClient()->mutateCampaignCriteria($accountId,
>  
> $operations);
> 
>
> The var_dump() prints: 
>  CampaignCriterionAdScheduleHelper.php:90:string 
> 'customers/9060438356/campaigns/9882431196' (length=41)
>
> But when i look at the request/log, campaign is not set for the operations.
> I tried to follow this example: 
> https:/

Re: error when creating new ad schedule (campaign criterion)

2020-10-05 Thread Google Ads API Forum Advisor Prod
Hi Frank,

Can you please reply privately to author your code so I can see if you set the 
campaign properly?

Thanks,
Anthony
Google Ads API Team

Anthony
Google Ads API Team
ref:_00D1U1174p._5004Q25Yela:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/UgIvK0QHQQ0Q00sqxuTEgiQ9mYZQADwaFnrQ%40sfdc.net.


Re: error when creating new ad schedule (campaign criterion)

2020-10-05 Thread fru...@adzlocal.de
Hi Anthony, 

thank you for the response. 
But unfortunately i don't get it - you said i should add 'campaign' => 
$campaignResourceName to the campaignCriterion, but that's exactly what i 
do in my code..?
Even the var_dump() prints the campaign resource name which has been set 
before. 

And what do you mean by passing the the variable int the function that 
creates the ad schedule?
I can't find any possibility to set a campaign for an ad schedule.

That's how my code looks like to create the ad schedules ($adScheduleData 
is a simple array with predefined start and end hours/minutes):

foreach ($adScheduleData as $weekDayName => $scheduleDataset) {
$adScheduleInfos[] = new AdScheduleInfo([
'day_of_week' => DayOfWeek::value($weekDayName),
'start_hour' => $scheduleDataset['startHour'],
'start_minute' => $scheduleDataset['startMinute'] ?? MinuteOfHour::ZERO,
'end_hour' => $scheduleDataset['endHour'],
'end_minute' => $scheduleDataset['endMinute'] ?? MinuteOfHour::ZERO,
]);
}

I appreciate any help!

Regards
Frank


adsapiforumadvisor schrieb am Freitag, 2. Oktober 2020 um 18:29:33 UTC+2:

> Hi Frank,
>
> You will need to set the campaign just like how the example you provided 
> did.
>
> In the campaignCriterion object, you will need to add
> 'campaign' => $campaignResourceName
>
> You'll also need to provide pass the variable in the function that creates 
> the ad schedule.
>
> Regards,
> Anthony
> Google Ads API Team
>
> [image: Google Logo] 
> Anthony 
> Google Ads API Team 
>   
>
> ref:_00D1U1174p._5004Q25Yela:ref
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/7b759ef5-afee-4838-8463-b20234f8ac02n%40googlegroups.com.


RE: error when creating new ad schedule (campaign criterion)

2020-10-02 Thread Google Ads API Forum Advisor Prod
Hi Frank,

You will need to set the campaign just like how the example you provided did.

In the campaignCriterion object, you will need to add
'campaign' => $campaignResourceName

You'll also need to provide pass the variable in the function that creates the 
ad schedule.

Regards,
Anthony
Google Ads API Team

Anthony
Google Ads API Team
ref:_00D1U1174p._5004Q25Yela:ref

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/nw1jj0QHL1SG00i2aIcBZBRqChHZfOd2Rv-Q%40sfdc.net.