Get Ads using GAM API

914 views
Skip to first unread message

Dimitris Karaiskos

unread,
May 31, 2022, 5:12:18 AM5/31/22
to Google Ad Manager API Forum
Hi all,

I would like to imitate the below client script behavior using GAM API.
  1. is that possible in general using GAM API?
  2. if yes, can you please provide me some pointers to examples on how to achieve that or references to java classes involved (I'll use the Java library to integrate with GAM API)
Thank you in advance for your time!

client script:
<!-- Start GPT Tag -->
<script async src='https://securepubads.g.doubleclick.net/tag/js/gpt.js'></script>
<script>
  window.googletag = window.googletag || {cmd: []};
  googletag.cmd.push(function() {
    googletag.defineSlot('/network_id/ad_unit_code', size, div_id)
             .setTargeting('target1_key', 'target1_value')            
             .addService(googletag.pubads());
    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
  });
</script>
<!-- End GPT Tag -->

Ad Manager API Forum Advisor

unread,
May 31, 2022, 10:28:17 AM5/31/22
to dkara...@atypon.com, google-doubleclick...@googlegroups.com
Hi Dimitris,

Thank you for reaching out to the Ad Manager API support team, this is Madhushree.

Generating a GPT tag is supported by Ad Manager 360 as of now, Ad Manager API does not support generating ad tags. However, I have raised your issue with rest of our team and one of our teammates will get back to you once we have an update on this.

Regards,
Google Logo
Madhushree
Ad Manager API Team
 

 

ref:_00D1U1174p._5004Q2bFEoQ:ref

Ad Manager API Forum Advisor

unread,
May 31, 2022, 3:41:59 PM5/31/22
to google-doubleclick...@googlegroups.com, dkara...@atypon.com
Hi Dimitris,

I'm Ankam, a colleague of Madhushree.

Do you want to use Java SDK to make ad requests instead of GPT and where will you be making the calls from? If you are trying to make calls from a mobile app, then you can use the Mobile Ads SDK. If you're in an environment that can't use GPT or the SDKs, then you can try using Tagless Requests. Hope this helps.

Regards,
Google Logo
Ankam
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2bFEoQ:ref

Dimitris Karaiskos

unread,
May 31, 2022, 4:12:44 PM5/31/22
to Google Ad Manager API Forum
Hi Ankam,  Madhushree,

thank you both for your prompt reply. What I am trying to succeed is to retrieve GAM Ads and show them in email newsletter.
I have already tried Tagless Requests, and came across 3 problems:
  1. impressions were not counted/reported in GAM LineItem admin page
  2. clickthrough url was not working all the times
  3. the ad itself was not showing up in some email clients (Gmail was one of them!)
So I was thinking whether it is possible to make the GPT calls server-side, where the email newsletter application resides. We are using mainly Java stack but we could employ other technologies as well.

I am open to discussing either the server-side option or if you have insights to make the Tagless Requests work.
Thank you

Ad Manager API Forum Advisor

unread,
Jun 1, 2022, 6:23:11 AM6/1/22
to dkara...@atypon.com, google-doubleclick...@googlegroups.com
Hi Dimitris,

Hope you are doing well and thank you for providing detailed information.

These are answers for your queries and to make Tagless Request work you have to note all this information.

1. If you are trying with Tagless Requests that use gampad/ad in HTML image tags (<img>) note that they don't support JavaScript tracking code and are not supported for downloaded impression counting. To report on these ads, use the "Total code served count" metric in Ad Manager reporting.

2&3. As per our help center article, the Email newsletter ads come under unsupported features with Tagless requests. Most email clients do not provided Google Ad Manager with sufficient information for accurate ad selection. There are also technical limitations. For example, the c= parameter needs to be a randomly-generated number and many click-through URLs require information from browser cookies. I would suggest you to verify on providing all required information.

In addition to that, regarding whether it is possible to make GPT calls server side, I have raised this issue with the rest of our team and one of our teammate will provide you an update at the earliest.

Regards,
Google Logo
Madhushree
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2bFEoQ:ref

Ad Manager API Forum Advisor

unread,
Jun 1, 2022, 6:27:50 PM6/1/22
to google-doubleclick...@googlegroups.com, dkara...@atypon.com
Hi Dimitris,

I am Chekurthi, Madhusree's colleague and I will be assisting you.

I would like to inform you that information related to GPT calls on the server side is out of our team's scope. As, we support issues related to the Ad Manager API only, I would request you to please post your issue in the Ad Manager Help for further assistance.

Regards,
Google Logo
Chekurthi
Ad Manager API Team
 


ref:_00D1U1174p._5004Q2bFEoQ:ref

Dimitris Karaiskos

unread,
Jun 7, 2022, 8:03:28 AM6/7/22
to Google Ad Manager API Forum
Thank you all for the info provided.

In summary, and if I have understood correctly, GAM API does not support requests of the equivalent of GPT scripts fetching Ads on a web page.

Thank you

Ad Manager API Forum Advisor

unread,
Jun 7, 2022, 9:37:38 AM6/7/22
to dkara...@atypon.com, google-doubleclick...@googlegroups.com
Hi Dimitris,

Yes, you are correct that the Ad Manager API does not support requests of the equivalent of GPT scripts fetching Ads on a web page. I would request you to please post your issue in the Ad Manager Help for further assistance.
Reply all
Reply to author
Forward
0 new messages