Inventory Check with Preset Names

137 views
Skip to first unread message

Solomon Paul

unread,
Nov 29, 2023, 7:08:50 AM11/29/23
to Google Ad Manager API Forum
Hi, 

Using Google ad manager API, is it possible to check inventory and see how much impression and users we have for future dates?

What google ad manager API service should we use to do this?

Thanks,
Solomon

Ad Manager API Forum Advisor

unread,
Nov 29, 2023, 9:23:19 AM11/29/23
to solomon...@gmail.com, google-doubleclick...@googlegroups.com
Hi,

Thank you for contacting the Ad Manager API support team.

Based on the information provided, I understand that you want to check the available inventory via the API. An AvailabilityForecast reports the maximum number of available units with which the line item can be booked. This forecast is analogous to the check inventory feature in the UI. Alternatively, you can refer to this help article to check the inventory in the UI to see the same information.

The forecast includes the available, matched, possible, delivered, and reserved units. It can also include all the contending line items and the available units for each targeting breakdown depending on the options set in the AvailabilityForecastOptions. By default, neither is included in the forecast.

You can refer to this sample java code of getAvailabilityForecast available in the ForecastService and all the available client libraries of the Ad Manager API. Hope this helps.
 

This message is in relation to case "ref:!00D1U01174p.!5004Q02qVZdo:ref"

Thanks,
 
Google Logo Ad Manager API Team


Solomon Paul

unread,
Nov 29, 2023, 9:52:03 AM11/29/23
to Google Ad Manager API Forum
Hi,

Thank you for the message, is it not possible to check inventory on API instead of the above feature in the UI, because I want to run the inventory check for couple of presets we already created, is there a way to do it please?

Thanks,
Solomon

Ad Manager API Forum Advisor

unread,
Nov 29, 2023, 2:54:43 PM11/29/23
to solomon...@gmail.com, google-doubleclick...@googlegroups.com
Hi,

Thank you for getting back to us.

Upon checking further, I understand that you want to run the inventory check for couple of presets which were created already. Could you please provide us with the relevant UI screenshot of the scenario that you are referring to which would be helpful for us to assist you better.

You can send the details via Reply privately to the author option, or direct private reply to this email.

Solomon Paul

unread,
Nov 30, 2023, 7:00:42 AM11/30/23
to Google Ad Manager API Forum
Hi,


and we have already created preset targets here:
Capture.JPG

Ad Manager API Forum Advisor

unread,
Dec 1, 2023, 8:31:40 AM12/1/23
to solomon...@gmail.com, google-doubleclick...@googlegroups.com
Hi,

Thank you for getting back to us.

According to the API documentation, Ad Manager API doesn't have a direct method of checking the inventory specifically for a "preset" in the API. Presets typically refer to predefined configurations for entities like creatives or ad units, and they are used during the setup process.

However, if you're interested in checking the available inventory for a specific set of criteria, you can do so by querying the ad units using the PQL statement and checking the forecasted inventory using the ForecastService . This is similar to what was discussed earlier regarding line items which is the Inventory shown in the check inventory feature of the UI for a lineitem. This forecast includes the available, matched, possible, delivered, and reserved units. You can refer to this sample java code of getAvailabilityForecast available in the ForecastService and all the available client libraries of the Ad Manager API. 

Solomon Paul

unread,
Dec 6, 2023, 5:33:26 AM12/6/23
to Google Ad Manager API Forum
Hi, 

Thank you so much for the more details on this, my only last question is please, if we are to check the inventory for a specific set of criteria, our main concern and focus would be to check inventory for set of audience target, we use two third party tool to target audience that is grapeshot and cxense, as attached below screenshot is this something possible to do using GAM API please?



Thanks,
Solomon
targeting_segement.JPG

Ad Manager API Forum Advisor

unread,
Dec 6, 2023, 8:45:40 AM12/6/23
to solomon...@gmail.com, google-doubleclick...@googlegroups.com
Hello Solomon,


Thank you for getting back to us.

Yes, you can check the custom targeted values for the required LineItem using the Ad Manager API. From the getLineItemsByStatement() operation, you will be able to get the AudienceSegmentCriteria under the type CustomCriteriaSet. You may refer to the Java code samples of the LineItemService and all available client libraries for the Ad Manager API.

Hope this helps. For any other assistance you may get back to us.

Solomon Paul

unread,
Dec 6, 2023, 9:33:44 AM12/6/23
to Google Ad Manager API Forum
Thank so lot, is there a sample or structure or format of a python code, in order to achive this customer targeting and check the inventory using API service account please?

Thanks,
Solomon

Ad Manager API Forum Advisor

unread,
Dec 7, 2023, 7:14:31 AM12/7/23
to solomon...@gmail.com, google-doubleclick...@googlegroups.com
Hi Solomon,


Thank you for getting back to us.

I would like to inform you that you can check this Python code sample for creating the LineItems with the custom targeting. You can create an object as custom_criteria_set where it should be taken in the targeting i.e.
targeting = {
    # Existing targeting parameters...
    'customTargeting': custom_criteria_set
}
You can get the particular LineItem using this Python code sample by adding the filter. You may refer to the PQL guide for more information.
statement = ad_manager.StatementBuilder(version='v202311')
    .Where('Id = :line_item_id')
    .WithBindVariable('line_item_id', line_item_id)
    .Limit(1)
    .ToStatement()

Ad Manager API Forum Advisor

unread,
Aug 14, 2025, 12:47:13 PMAug 14
to solomo...@mediahuis.co.uk, google-doubleclick...@googlegroups.com, solomon...@gmail.com
Hi,

Could you please share the uncropped screenshot of Ad Manger UI fields which you are trying to retrieve via API, so that we can check further.

Thanks,
 
Google Logo Ad Manager API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-08-14 16:46:31Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02qVZdo:ref" (ADR-00213051)



Ad Manager API Forum Advisor

unread,
Aug 14, 2025, 12:49:31 PMAug 14
to google-doubleclick...@googlegroups.com, solomo...@mediahuis.co.uk, solomon...@gmail.com
Hi,

Please ignore my previous response.

Could you please share the uncropped screenshot of Ad Manger UI fields which you are trying to retrieve via API, so that we can check further. You can send the details via Reply privately to the author option, or direct private reply to this email.

Thanks,
 
Google Logo Ad Manager API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-08-14 16:49:12Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02qVZdo:ref" (ADR-00213051)



Ad Manager API Forum Advisor

unread,
Aug 18, 2025, 1:38:00 PMAug 18
to solomo...@mediahuis.co.uk, google-doubleclick...@googlegroups.com, solomon...@gmail.com
Hi,

I would like to confirm that 'Check Inventory' for 'TargetingPresets' is still not supported via the API, it is available only in the UI. I will raise a request to add this feature in the Ad Manager API. With that being said, I'm unable to comment on when the pricing rules would be supported in the Ad Manager API. I'd advise you to follow our Blog Post and Release Notes for announcements about new API releases and features.? ? ? ? ? ? ? ?

Thanks,
 
Google Logo Ad Manager API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5

[2025-08-18 17:37:40Z GMT] This message is in relation to case "ref:!00D1U01174p.!5004Q02qVZdo:ref" (ADR-00213051)



Reply all
Reply to author
Forward
0 new messages