Get schedule for campaigns

33 views
Skip to first unread message

Mathieu Dubreuil

unread,
Mar 12, 2018, 12:18:42 PM3/12/18
to AdWords API Forum
Hi,

I am simply trying to get the schedules for all of my campaigns and I can't seem to figure out how. I do not want to modify anything, simply retrieve the information about which days every campaign is running. I've found the CampaignCriterionService but I don't understand how to simply set the return values to AdSchedules.

Is it possible to get this and not use it as a predicate?

Thank you!

Zweitze

unread,
Mar 12, 2018, 1:15:13 PM3/12/18
to AdWords API Forum
I get that information, indeed from CampaignCriterionService.

I do use a predicate on CriterionType. (In case you don't know, a predicate is essentially a filter). The predicate is:
CriteriaType EQUALS "AD_SCHEDULE"
Note: If I don't set up this predicate I get thousands of rows back on other criterion types, like languages and locations and what else. If you insist on not setting up this predicate, you should prepare your software for a lot of different results. And a slow response from the API as well. And you have to implement paging because the API won't return more than a few thousand rows in a single call.

Dhanya Sundararaju (AdWords API Team)

unread,
Mar 12, 2018, 3:09:52 PM3/12/18
to AdWords API Forum
Hi all,

When you do a getCriterion() on CampaignCriterion, for all campaignCriterion->getCriterion()->getCriterionType() = AD_SCHEDULE it will return a sample response as below:
'AdSchedule{criterionType=AdSchedule, dayOfWeek=SATURDAY, endHour=24, endMinute=ZERO, id=350096, startHour=0, startMinute=ZERO, type=AD_SCHEDULE}'

You can then handle programmatically at your end to pull up required values. Please let me know if you have further questions.

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages