need amp-ad-custom usage explain and example codes

204 Views Asked by At

I'm tying to creating my custom ad server with my special customers. I reading, reading, reading... not understand this documention on the amp.dev site --> https://amp.dev/documentation/components/amp-ad-custom/

my site https://example.site fully amp and valid, my adsite https://ads.site fully amp4ads and valid,

https://example.site/ex-page.html content :

<!DOCTYPE html>
<html ⚡ lang="tr">
<head>... 
BLA BLABLA other contents..
</head>
<body>
<amp-ad-custom width="320" height="250" src="https://ads.site/ex-ads.html"></amp-ad-custom>
</body>
</html>

https://ads.site/ex-ads.html content:

<? header("Access-Control-Allow-Origin: https://example.site");
header("Access-Control-Allow-Credentials: true");
header("AMP-Ad-Template-Extension: amp-mustache");
header("Amp-Ad-Response-Type: template");?>
<!DOCTYPE html>
<html ⚡4ads>
<head>... 
BLA BLABLA other contents..
</head>
<body>
<amp-img src="https://ads.site/image/pizza.png" width="300" height="250" layout="fixed" alt="pizza"></amp-img>
</body>
</html>

Is there an error in the tag association process I made? amp verification of all pages ok.

Where will we use the JSON text under the ad-server heading mentioned in the amp-ad-custom documentation?

Ad server

The ad network needs to provide a new serving endpoint that returns a CORS response in a JSON format:

{
  templateUrl: "https://adexample.com/amp_template_1.html",
  data: {
    clickUrl: "https://buy.com/buy-1",
    buttonText: "Buy now"
  },
  analytics: {
    type: "googleanalytics",
    config: {
      ...
    }
  }
}

I tried differently. After all attempts, the place for the amp-ad-custom tag is empty. does not show anything on the page. There is only 1 error in the error console.

Invalid recovery mode! ................ error.js:208

I could not find more information and examples of component anywhere on the internet. Is it possible to write a sample with sample links and file contents?

0

There are 0 best solutions below