Manual Ad Triggering

AMP IMA implementation offers a requestAd() method in which you can manually trigger ads, we do highly recommend to use VMAP ads in which the ad timing is configured already by the ad provider. There are some special cases in which you might require requestAd, here is an example.

Supposing that you want to trigger a single ad during a live stream based on whether user action or local time you can invoke the requestAd.

function loadAd(event) {
			  if (!;

If you want to play or change the adTagUrl dynamically you can use player parameterization, in which you bind a specific player value with a variable scoped on page level or app.

//default adTag
window.adTag = ""

var config = {
	plugins: {
		ima: {
      		resources: [
        		{src: "//", debug: "//", type: "text/javascript", async: true},
        		{src: "${paths.plugins}amp-ima/Ima.min.js", debug: "${paths.plugins}amp-ima/Ima.js", type: "text/javascript", async: true}
		adTagUrl: "#{window.adTag}",
		vpaidMode: "enabled"

akamai.amp.AMP.create("akamai-media-player", config);

loadAd() {
    window.adTag = newAdTag; // here the new ad tag is set.

	if (!; // call requestAd after new ad tag was set.

Once the adTagUrl was updated you can trigger requestAd() in order to request the new ad.