How to get AdSchedule Data and Change Bid for Adgroup / keyword - Google Ads API Beta

116 views
Skip to first unread message

cv

unread,
Jul 24, 2019, 6:33:52 AM7/24/19
to AdWords API and Google Ads API Forum
Hi,

Please suggest best possible way to get Campaign Ad Schedules.
How I can get all adschedules info like Day of week, Start time, end time, and how much bid increase or decrease set?

Also How I can change bid for Adgroup/ keywords?

I am looking for Google Ads API beta.

Thanks,

Google Ads API Forum Advisor Prod

unread,
Jul 24, 2019, 5:39:58 PM7/24/19
to chirag....@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out. You could use the ad_schedule_view resource to get Campaign Ad Schedule information in Google Ads API. The attribute resource ‘campaign_criterion’ selectable with ad_schedule_view will provide all the information like campaign_criterion.ad_schedule.day_of_week,campaign_criterion.ad_schedule.start_hour, campaign_criterion.ad_schedule.end_hour,campaign_criterion.bid_modifier.

For your other concern , you could use AdGroupBidModifierService to change the bid for Adgroup level. Refer to this code sample to add bid modifier at Ad group level. Also, you could use AdGroupCriterionService to mutate bids at criterion(keyword) level. Please refer to the migration document for the equivalent services in Google Ads API. Let us know if you need additional information.

Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UEGEyi:ref

cv

unread,
Jul 25, 2019, 7:25:39 AM7/25/19
to AdWords API and Google Ads API Forum
Hello Nikisha,

I can able to get campaign criteria.

But, I think that example for AddAdGroupBidModifier is not useful.

I wanted to change AdGroup CPC itself and not the its criteria. Please let me know If i am wrong.

Thanks,
Message has been deleted

Google Ads API Forum Advisor Prod

unread,
Jul 25, 2019, 3:28:40 PM7/25/19
to chirag....@gmail.com, adwor...@googlegroups.com

Hi,

Thanks for the clarification. To update the Cpc bid for Adgroup you need to use Fieldmask utility to derive the update mask which will tell Google Ads API which attribute of Ad Group will be updated. Please refer to the similar code Update Ad Group in Google Ads API to update CPC bid.



Regards,
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UEGEyi:ref

cv

unread,
Jul 26, 2019, 6:57:06 AM7/26/19
to AdWords API and Google Ads API Forum
Thanks For the Information.

I was able to change the BID.

Now I have step forward and tried to change Bid for the Device.

I have done like this But this gives me Segmentation Fault: 11

$bidModifierValue = 1.5;
            $adGroupBidModifier = new AdGroupBidModifier([
                'ad_group' => new StringValue(
                    ['value' => ResourceNames::forAdGroup($customerId, $adGroupId)]
                ),
                'bid_modifier' => new DoubleValue(['value' => $bidModifierValue]),
                'device' => new DeviceInfo(['type' => Device::MOBILE])
            ]);

            print_r($adGroupBidModifier);exit;
            // Creates an ad group bid modifier operation for creating an ad group bid modifier.
            $adGroupBidModifierOperation = new AdGroupBidModifierOperation();
            $adGroupBidModifierOperation->setUpdate($adGroupBidModifier);
            $adGroupBidModifierOperation->setUpdateMask(FieldMasks::allSetFieldsOf($adGroupBidModifier));

            // Issues a mutate request to add the ad group bid modifier.
            $adGroupBidModifierServiceClient = $googleAdsClient->getAdGroupBidModifierServiceClient();
            $response = $adGroupBidModifierServiceClient->mutateAdGroupBidModifiers(
                $customerId,
                [$adGroupBidModifierOperation]
            );

thanks,

Google Ads API Forum Advisor Prod

unread,
Jul 26, 2019, 3:53:44 PM7/26/19
to chirag....@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching support. Could you please share the complete request and response logs along with the client customer Id for me to investigate further? Please use Reply privately to author option while sharing the details.



Regards, 
Nikisha Patel, Google Ads API Team



ref:_00D1U1174p._5001UEGEyi:ref

cv

unread,
Jul 31, 2019, 2:44:31 AM7/31/19
to AdWords API and Google Ads API Forum
Hi,

I have shared the response privately.

Thanks,
Reply all
Reply to author
Forward
0 new messages