API call to get ads

's Avatar


29 Mar, 2018 03:29 PM

Is there a way to get a listing (either server or client but preferably server) of ads? We are implementing the suggested method (http://www.advertserve.com/blog/2017/10/google-chrome-adblock/) of displaying the lightbox ads to get around Google Chrome's Ad Blocker. We're hard-coding the "splash screen" as recommended so no flash of content is happening. Our concern now is to not render that "splash screen" code when an ad is not returned from AdvertServe (maybe the number of impressions were reached). We thought we could hopefully utilize the API to check if that ad is returned.

On the client, I noticed a "viewabilityRegistry" array on the global "AVP" object. I was thinking of matching our ad logic against the "parentTagId" to render or not render the ads. However, we would still probably see a flash of the splash screen before this logic would run (hence the preference for a server solution).

Do you have any thoughts or suggestions?

Phil Amato
Technotects, Inc.

  1. Support Staff 1 Posted by Mike Cherichett... on 29 Mar, 2018 04:16 PM

    Mike Cherichetti's Avatar

    Hi Phil,

    We do have a prefetch API that you can use to get the next ad or it will return nothing if the zone or campaign(s) have caps that are reached.


    It can be used client-side or server-side, but there are some considerations if you're going to do it server-side. You need to make sure you send the Accept-Language, Referer and User-Agent headers from the client along with the server-side request. The clients IP address should also be sent in an X-Forwarded-For header. You also need to emulate cookies for frequency capping to work though. What I'd suggest there is just sending an AVPUID cookie with a value that's an MD5 hash of the client IP and User-Agent. That won't be perfect as multiple users could share the same IP and have the same User-Agent, but it's kind of the best you can do with server-side cookies.

    But, yeah, it is annoying that you see the splash screen flash for a split second before our callback closes it. The sample code in our blog article is kind of dead simple though because it just simply hides the splash screen. You might be able to improve it a bit by using a fade out animation on it. A few clients have done that and it does smooth out page transitions, but if you can get the server-side solution implemented to avoid painting the splash screen at all that would be way better.


  2. Mike Cherichetti closed this discussion on 05 Apr, 2018 07:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

03 Aug, 2020 08:33 PM
22 Jun, 2020 06:51 PM
07 Feb, 2020 05:39 PM
10 Dec, 2019 05:28 PM
09 Sep, 2019 02:07 PM

Recent Articles