How to find all the included children of ad unit which part of a placement. Expl. in detail in body

426 views
Skip to first unread message

justde...@gmail.com

unread,
Oct 20, 2016, 2:35:30 AM10/20/16
to Google's DoubleClick for Publishers API Forum
Hello there,

My question is briefly mentioned is subject. Following is the detail scenario.

Lets, assume I have ad unit : GE-B2M-SPORT
Above ad unit has following children ad units : football, cricket, sprint, badminton, rowing.

Now, I will create a placement named "PL-GE-SPORT" which will have ad unit : GE-B2M-SPORT with all it's children included.

Now, when I query with placement service, for this placement by id, it will return me "targetedAdUnitIds = Id of GE-B2M-SPORT", But it does not return me the ids of children ad unit.


So my question is, how can I retrieve all the included children of ad unit of given placement.

Please write me if I have't explained my question adequately. 

Thank you

Milan 

Vincent Racaza (DFP API Team)

unread,
Oct 20, 2016, 3:07:47 AM10/20/16
to Google's DoubleClick for Publishers API Forum
Hi Milan,

The get placements method of PlacementService only returns the targetedAdUnitIds which are directly under your placement. In your case, since the parent ad unit "GE-B2M-SPORT" is directly under your "PL-GE-SPORT" placement, then it will only return that parent ad unit. So, to retrieve the child ad units, you need to use the get ad units method of the InventoryService filtering by parentId. You can have this query filter in the get ad units method:

.where("parentId = id of GE-B2M-SPORT")

Let me know if you have further questions.

Thanks,
Vincent Racaza, DFP API Team

justde...@gmail.com

unread,
Oct 20, 2016, 3:23:10 AM10/20/16
to Google's DoubleClick for Publishers API Forum
Hi Vincent,

Thank you for the info. So I got that part. Now there is little twist in this,

I have one more scenario where, say our parent ad unit "GE-B2M-SPORT" has 10 children ad units, but out of that 10 children, 8 has been included in placement. In this case when I query placement, it will give me only parent ad unit, that is "GE-B2M-SPORT", but now if I query ad unit with parent id field then I will get all 10 which is not correct for me, because I want that "included 8" children only. 

Is there any hack into this where I can get only children which are included?

Thank you,

Milan

Vincent Racaza (DFP API Team)

unread,
Oct 20, 2016, 3:48:45 AM10/20/16
to Google's DoubleClick for Publishers API Forum
Hi Milan,

In your scenario where there are only 8 children ad units which are added to a placement (not all the 10 ad units of a parent ad unit), then the 8 ad units will be returned in the targetedAdUnitIds property of the get placements method. This is because the 8 children ad units are directly under your placement. You can verify this scenario in both UI and API.

Thanks,
Vincent Racaza, DFP API Team

justde...@gmail.com

unread,
Oct 20, 2016, 6:26:59 AM10/20/16
to Google's DoubleClick for Publishers API Forum
Hi Vincent,

You are right. What you said is actually happening with my other placements, but this one is not behaving as it should be. My understanding was that, if you have included a parent ad unit in a placement that means all the children are also included and hence on query it will just return a parent, in other case if placement has specific children included on parent ad unit then upon querying placement will return thoese children not the parent only.

I wish I could show u what is happening in this special case which has puzzled me. :-)

Anyways, I talked with our DFP use team about this and we came to an agreement on this.

Thanks a lot

Milan
Reply all
Reply to author
Forward
0 new messages