BloggingHindi - Blogging Aur Internet Ki Sabhi Jankari

  • About Us
  • Contact Us
  • Blogging
  • WordPress
  • SEO

AMP Posts/Pages Me Adsense Ads Insert Kaise Kare [Without Plugin]

Last Updated on April 11, 2022 by Md Arshad Noor 2 Comments

आज हम आपको AMP posts/pages में Adsense Ads को insert करने के बारे में बताने जा रहे हैं. अगर आप भी अपने wordpress ब्लॉग में AMP का इस्तेमाल करते हो तो यह पोस्ट आपके लिए काफी helpful हो सकता है. हम आपको बिना किसी प्लगइन का इस्तेमाल किये ads insert करने के बारे में बताएँगे.

insert ads into amp post and pages without plugin

जब हम blogging की बात करते हैं तो सभी bloggers के लिए ads एक बहुत major thing होता है. हर कोई अपने ब्लॉग में मेहनत से पोस्ट लिखता है ताकि उन्हें उससे कुछ फायदा हो. हर blogger अपने ब्लॉग advertising दिखा करके या फिर affiliate marketing के द्वारा पैसे कमाते हैं.

ज्यादातर लोग अपने ब्लॉग में Advertising दिखाने के लिए Adsense का इस्तेमाल करते हैं. इसलिए आज हम आपको AMP pages में adsense का ads दिखाने के बारे में बताएँगे.

मुझसे अभी तक कई लोगों ने पूछा है की आप AMP pages में ads कैसे insert किये हो? कमेंट के माध्यम से में उन्हें सिर्फ इतना बता पाता था की “ये मेने manually coding से किया है” इसलिए आज उनलोगों के साथ आपको भी बताने वाला हूँ की AMP posts & pages में बिना प्लगइन के ads को कैसे दिखाएँ?

में अपने ब्लॉग में काफी समय से AMP का इस्तेमाल करता हूँ. इससे मुझे काफी positive result मिला है. चूँकि Google में amp को ख़ास मान्यता प्राप्त है. इसलिए mobile devices के लिए गूगल हमेशा amp pages पर ही ध्यान देता है.

अगर आपको इसके बारे में पता नहीं है तो मेने पहले से इसके बारे में पोस्ट लिख रखा है, आप उसे पढ़ सकते हो. साथ ही अगर आपको अपने ब्लॉग में amp को setup करना है तो आप इस पोस्ट को पढ़ सकते हो.

  • WordPress Me AMP Kaise Setup Kare [Complete Guide]
  • Google AMP Kya Hai? Complete Information Iske Bare Me
  • Google AMP Use Karne Ke Pros And Cons (Fayde Aur Nuksan)

में अपने ब्लॉग में “AMP for WP” plugin का इस्तेमाल करता हूँ. ऊपर दिए पोस्ट को पढ़कर आप भी अपने ब्लॉग में इसे setup कर सकते हो.
फ़िलहाल, में आपको बताने वाला हूँ की AMP post & pages में ads कैसे दिखाएँ? अगर आप “AMP for WP” plugin का इस्तेमाल करते हो तो ही ये आपके लिए work करेगा. अगर आप amp के लिए दुसरे plugin का इस्तेमाल करते हो तो ये आपके लिए work नहीं भी कर सकता है. (हमने test नही किया है)

तो चलिए हम आपको इसके लिए बहुत simple process बताने वाले हैं. आपको इसके लिए किसी तरह के plugin का इस्तेमाल भी नहीं करना होगा. बस आपको कुछ codes को अपने theme में add करना होगा.

  • Apko Blog Me Genesis Theme Kyu Use Karna Chahiye? [10 Reasons]
  • Nulled Theme/Plugin Kya Hota Hai? Isko Use Kyo Nahi Kare – Full Guide
  • Blogging se Paise Kamane ke Liye 7 Extra Ways
  • New Blogger Ko Kya Karna Chahiye Aur Kya Nahi Karna Chahiye (Dos and Don’ts)

Insert Adsense Ads to AMP Pages without Plugin

इसके लिए कई सारे method हैं. आप plugin के माध्यम से भी insert कर सकते हो. लेकिन में आपको सबसे अच्छा तरीका बता रहा हूँ. इसके लिए आपको plugin के coding को edit भी नही करना होगा. जिससे plugin update होने के बाद आपको code खोने की समश्या हो.

AMP में adsense ads को दिखाने के लिए normal pages के मुकाबले काफी अलग है. इसलिए सबसे पहले में आपको इसके बारे में समझा देता हूँ.
सबसे पहले आपको Adsense में लॉग इन करके अलग अलग types के ads create कर लेना है. आपको Ad code से publisher id और ad slot को copy कर लेना है. Example के लिए आप निचे देख सकते हो.

<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-7241177101992536"
data-ad-slot="8008299066"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

ऊपर green color में adsense publisher id है और red color में ad slot है. सभी ads के publisher id same ही होंगे, आपको सिर्फ ad slot को नोट कर लेना है. चलिए अब हम आपको ads insert करने के बारे में बता रहे हैं.

अब आपको निचे दिए code को modify करके अपने ब्लॉग theme के functions.php में add करना होगा. चलिए इसको modify करने के बारे में जानते हैं.

/**
* Add Google Adsense code to AMP
*/
add_action( 'pre_amp_render_post', 'isa_amp_add_content_filter_alt' );
function isa_amp_add_content_filter_alt() {
add_filter( 'the_content', 'isa_amp_adsense_within_multiple' );
}
function isa_amp_adsense_within_multiple( $content ) {
$ad_units = array(
1 => 'XXXXXXXXXX',
10 => 'XXXXXXXXXX',
20 => 'XXXXXXXXXX',
30 => 'XXXXXXXXXX',
);
$insertions = array();
foreach ( $ad_units as $paragraph => $ad_slot ) {
$insertions[ $paragraph ] = '<amp-ad class="amp-ad-1" type="adsense" media="(max-width: 649px)" width=300 height=100 layout="responsive" data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" data-ad-slot="' . $ad_slot . '"></amp-ad>';
}
// Insert Adsense ad after multiple paragraphs
$new_content = isa_insert_after_paragraph_multiple( $insertions, $content );
return $new_content;
}
function isa_insert_after_paragraph_multiple( $insertions = array(), $content ) {
$closing_p = '</p>';
$paragraphs = explode( $closing_p, $content );
foreach ($paragraphs as $index => $paragraph) {
if ( trim( $paragraph ) ) {
$paragraphs[$index] .= $closing_p;
}
// insert ad at multiple places
foreach ( $insertions as $paragraph_id => $ad_code ) {
if ( $paragraph_id === $index + 1 ) {
$paragraphs[$index] .= $ad_code;
}
}
}
return implode( '', $paragraphs );
}

जिस paragraph में ads insert करना है उसे blue color के number से replace कर सकते हो. हमने 1, 10, 20, 30 paragraph में ads insert कर रखा है. आप इसे अपने हिसाब से adjust कर सकते हो. Red color (XXXXXXXXXX) के जगह में अलग अलग ads के ad slot को replace करना होगा. उसके अलावा ca-pub-xxxxxxxxxxxxxxxx की जगह अपनी AdSense publisher id को add करना होगा.

अब आपके ब्लॉग म ads तो insert हो गये हैं लेकिन अभी ads show नही होगा. आपको निचे दिए गये code को अपने theme की functions.php में add करना होगा. उसके बाद ही आपके ब्लॉग ads show होगा.

/**
* Add the AMP Ad script to AMP pages.
*/
function isa_load_amp_adsense_script( $data ) {
$data['amp_component_scripts']['amp-ad'] = 'https://cdn.ampproject.org/v0/amp-ad-0.1.js';
return $data;
}
add_filter( 'amp_post_template_data', 'isa_load_amp_adsense_script' );

अब आपके ब्लॉग में ads show होने लगेंगे. इस तरह से बहुत आसानी से अपने amp पोस्ट और पेजेज में एड्स दिखा सकते हो. इसकी सबसे अच्छी बात ये है की जब भी plugin को update करोगे तो ads code remove नहीं होगा. क्योकि codes को हमने अपने theme के functions.php में add करके रखा है.

  • Adsense Payments Nahi Milne Par Payment Troubleshoot Form Kaise Submit Kare
  • Adsense Ads Placement Full Guide &#8211; With Infographic in Hindi
  • Hacker Kisi WordPress Site Ko Hack Kaise Karte Hai [5 Methods]
  • Security Ke Liye Gmail Account Me 2 Step Verification Ko Enable Kaise Kare.
  • Security Ke Liye WordPress Login URL Me Key Aur Value Kaise Add Kare

उम्मीद है की आपको ये पोस्ट पसंद आया होगा. इससे सम्बन्धित कोई सवाल पूछना है तो आप निचे comment कर सकते हो. अगर आपको पोस्ट पसंद आया है तो इसे social media में share जरुर करें. latest updates के लिए ब्लॉग के newsletter को join कीजिये.

You May Also Like

  • WordPress Me W3 Total Cache Plugin Ko SetUp Kaise Kare [Easy Method]

    WordPress Me W3 Total Cache Plugin Ko SetUp Kaise Kare [Easy Method]

  • Adsense Earning Increase Kaise Kare – 15 Tips and Tricks [Ultimate Guide]

    Adsense Earning Increase Kaise Kare – 15 Tips and Tricks [Ultimate Guide]

  • Facebook Reaction Buttons Ko WordPress Me Add Kaise Kare

    Facebook Reaction Buttons Ko WordPress Me Add Kaise Kare

  • Top 10 Common WordPress Mistakes – Jo Sabhi Beginners Karte Hai

    Top 10 Common WordPress Mistakes – Jo Sabhi Beginners Karte Hai

About Md Arshad Noor

हेलो दोस्तों, मेरा नाम मोहम्मद अरशद नूर है. में इस ब्लॉग में रेगुलर नई नई आर्टिकल्स लिखता हूँ. यहाँ पर हम ज्यादातर Blogging, Make Money, SEO, WordPress आदि से सम्बंधित Article मिलेगी. आपको हमारी लेख पसंद आती है तो इसे सोशल मीडिया में शेयर करें। अगर आपको कोई सहायता चाहिए तो कमेंट कीजिए।

COMMENTs ( 2 )

  1. myinfo says

    Hi, Amazing and easy to read an article, This is very useful information for me as a beginner blogger.

    Reply
  2. Kamlesh says

    Post ke Sabse neeche aur share button
    Ke uper wali Adsense ad kaise Lagate hain

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Please do not spam! otherwise your comment will be removed.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Useful Articles

Google Keyword Ranking Check karne ke liye 5 Best Website

Website Ko User Friendly Banane Ke Liye 5 Secrets

PHP Version Ko Upgrade Karke Site Speed Ko 20% Increase Kare

WordPress Toolbar/Adminbar Ko Hide Aur Customize Kaise Kare

Adsense Account Kaise Banaye [Step By Step]

Blogging Ke 10 Important Myths ke Bare Me Apko Pata Hona Chahiye

Hostlelo Review – A Great Solution for New Bloggers

QR Code Kya Hai? QR Code Kaise Banaye aur Scan Kaise Kare

Blog Me Live Cricket Score Widget Kaise Add Kare

7 Karn WordPress Me Jyada Plugin Use Nahi Karni Chahiye

Directory Browsing Kya Hota Hai-Isko Disable Karne Ke 2 Tarike

Twitter Account Ko Secure Kaise Rakhe

Blog ko Delete kaise kare aur Delete kiya hua blog wapas kaise laye

About Us

mdarshadnoorहेल्लो दोस्तों, मेरा नाम मोहम्मद अरशद नूर है. में अररिया, बिहार का रहने वाला हूँ. मुझे नयी चीजें सीखना-सिखाना बहुत पसंद है. में पिछले 5 सालों से ब्लॉगिंग के फील्ड में हूँ. इस ब्लॉग में आपको ब्लॉगिंग और इन्टरनेट से सम्बन्धित जानकारी मिलेगी.

SUBSCRIBE OUR NEWSLATTER

हमारे नवीनतम पोस्ट की सूचना एवं उपयोगी सामग्री प्राप्त करने के लिए हमसे जुड़ें

Posts for WP Users:

WordPress Site Ki HTML, CSS Aur JavaScript Ko Minify Karke Speed Badhaye

WordPress Blog Me JavaScript Ko Footer Me Load Kaise Kare [Without Plugin]

WordPress Database Prefix Change Kaise Kare – Security Ke Liye

Cornerstone Content Kya Hai? Cornerstone Content Kaise Likhte Hai?

Blog Post Ki Heading Ko Stylish Design Kaise Kare. Without Plugin

More Posts from this Category

DMCA.com Protection Status

Recommended For You

WordPress Blog Me JavaScript Ko Footer Me Load Kaise Kare [Without Plugin]

WordPress Ke 10 Myths – Apko Pata Hona Chahiye

Blog Post ke liye Picture kaha se Download kare

JetPack Social Sharing Buttons Ko Stylish Aur Colorful Kaise Banaye

15 Feb 2018 Ko Google Chrome Me Native Ad Blocking Launch Hoga

Website Ko User Friendly Banane Ke Liye 5 Secrets

Copyright © 2021 - All rights reserved. AboutContactSitemapDisclaimer