amp-wp
amp-wp copied to clipboard
How to insert advertising in the middle of an article
Hi, how we can insert advertising in the midst of an article?
We have now entered a code like this that I am attaching below in the file single.php.
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- OverPress Reattiva -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-2943502232807001"
data-ad-slot="6611099574"
data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
Check this. http://dfp-amp-testing-1185.appspot.com/ i have implemented this. It works for me.
See https://github.com/Automattic/amp-wp#custom-sanitizer for building a custom sanitizer to inject ads.