The key to reducing latency in your IMA-enabled web page is to do as much IMA-related setup as early as possible. You can do all of the following on your web page as early as you like before playing ads:
- Create your
AdDisplayContainer
. - Create your
AdsLoader
. - Create your
AdsRequest
. - Request ads.
- Obtain your
AdsManager
instance and register event handlers.
AdDisplayContainer.initialize()
(always
as the result of a user action), then call AdsManager.init
and
AdsManager.start
. For more information on making your entire page more responsive, see the tips on evaluating network
performance in the Chrome documentation.