-->

Kode Iklan Adsense Dua Versi AMP dan Non AMP

Kode Iklan Adsense Dua Versi AMP dan Non AMP
Memasang kode iklan Google Adsense dengan dua versi akan menjadi lebih baik untuk blog yang sudah menggunakan Template AMP, karna jika blog jenis amp anda masih mengunakan kode hanya untuk satu versi yaitu AMP saja iklan yang muncul pada browser akan menjadi kurang epektif, jadi silahkan sebaiknya Anda gunakan dua kode dalam Dua Versi AMP dan Non AMP.

Untuk melakukan penggantian kode iklan ini pertama Anda harus merubah Template Anda terlebih dahulu ke dua versi AMP dan Non AMP. Jika belom saya sudah membuat artikel sebelum nya silahkan baca dan ikuti terlebih dulu : Membuat Blog Versi AMP dan Non AMP

Selanjutnya bila telah anda mengganti template dengan cara sebelumnya silahkan hapus kode Adsense yang telah di pasang di template anda dan gunakan kode yang saya berikan dibawah ini.


1. KODE IKLAN AMP DAN NON AMP DIPASANG DI ATAS / HEADER

<b:if cond='data:blog.isMobileRequest == &quot;false&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan desktop -->
<ins class='adsbygoogle' data-ad-client='ca-pub-842110759957333' data-ad-format='auto' data-ad-slot='8540246333' style='display:block'/>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</b:if>
<b:if cond='data:blog.isMobileRequest == &quot;true&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan AMP/mobile -->
<amp-ad data-ad-client='ca-pub-8421107599573333' data-ad-slot='8540246333' height='250' layout='fixed-height' type='adsense'>
</amp-ad>
</b:if>

2. KODE IKLAN AMP DAN NON AMP DIPASANG DI HOMEPOST

<b:if cond='data:blog.isMobileRequest == &quot;false&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan desktop -->
<ins class='adsbygoogle' data-ad-client='ca-pub-8421107599572333' data-ad-format='auto' data-ad-slot='8540246333' style='display:block'/>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</b:if>
<b:if cond='data:blog.isMobileRequest == &quot;true&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan AMP/mobile -->
<amp-ad data-ad-client='ca-pub-8421107599572333' data-ad-slot='8540246333' height='90' layout='fixed-height' type='adsense'>
</amp-ad>
</b:if>

3. KODE IKLAN AMP DAN NON AMP DIPASANG DI BAWAH ARTIKEL

<b:if cond='data:blog.isMobileRequest == &quot;false&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan desktop -->
<ins class='adsbygoogle' data-ad-client='ca-pub-8421107599572430' data-ad-format='auto' data-ad-slot='8540246253' style='display:block'/>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</b:if>
<b:if cond='data:blog.isMobileRequest == &quot;true&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan AMP/mobile -->
<amp-ad data-ad-client='ca-pub-8421107599572430' data-ad-slot='8540246253' height='100' layout='fixed-height' type='adsense'>
</amp-ad>
</b:if>

4. KODE IKLAN AMP DAN NON AMP DIPASANG UNTUK SIDEBAR ( Biasa saya pasang tepat diatas kode <b:section class='sidebar' id='sidebar' preferred='yes'> )

<b:if cond='data:blog.isMobileRequest == &quot;false&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan desktop -->
<ins class='adsbygoogle' data-ad-client='ca-pub-8421107599572430' data-ad-format='auto' data-ad-slot='8540246253' style='display:block'/>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</b:if>
<b:if cond='data:blog.isMobileRequest == &quot;true&quot; and not data:blog.searchQuery'>
<!-- Ini iklan untuk tampilan AMP/mobile -->
<amp-ad data-ad-client='ca-pub-8421107599572430' data-ad-slot='8540246253' height='250' layout='fixed-height' type='adsense'>
</amp-ad>
</b:if>

Lihat hasil kode yang telah dipasang di Blog AMP HTML DISINI

NB: Untuk kode yang saya warnai BIRU silahkan ganti dengan kode ca-pub dan data-ad-slot milik Anda.

Selamat mencoba.

Advertisement
Kode Iklan Adsense Dua Versi AMP dan Non AMP