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 January 5, 2021 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

  • Kisi Bhi Blogger ya WordPress Blog Ka Theme/Template Kaise Check Kare

  • WordPress Use Karne Ke Fayde Aur Nuksan (Pros And Cons)

    WordPress Use Karne Ke Fayde Aur Nuksan (Pros And Cons)

  • WordPress Blog Me Broken Link Ko Fix Kaise Kaise

    WordPress Blog Me Broken Link Ko Fix Kaise Kaise

  • Hindi Blog Me Adsense Se Jyada Income Karne ke Liye 6 Secrets

    Hindi Blog Me Adsense Se Jyada Income Karne ke Liye 6 Secrets

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.

Get it on Google Play

Useful Articles

Khush Nahi Rahne Wale Logo Ki 5 Buri Aadte

Revenue Hits kya hai aur isme Account kaise banaye

Blogspot Blog me Country Specific Redirect Disable kaise Kare

Spam Mail Sender Se Unsubscribe Karke Spam Mail Se Kaise Bache

Google Me Search Karne Ke Top 10 Tips & Trick – [Get Right Results Fast]

Google Search Results Me Blog Ke Sabhi Posts Me Star Rating Kaise Dikhaye

Blog Homepage Me Only Post Title Kaise Dikhaye

Blogging me fail hone ka 10 sabse Bada Karan

Social Media se More Traffic Pane ke Liye 10 Important Tips

Quora Se Blog Ki Traffic Kaise Badhaye? 5 Tips

Blog Post me Keyboard key kaise lagaye

YouTube Se PR9 Dofollow Backlink Kaise Receive Kare

Blog Post Copy Hone Par Copyright Post Me Automatic Apne Blog Ki Link Add Kare

About Us

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

SUBSCRIBE OUR NEWSLATTER

हमारे ब्लॉग के रेगुलर विजिटर हो तो अभी Subscribe कर लीजिए ताकि आप हमारे नए पोस्ट को सबसे पहले पढ़ पाएँ!

Posts for WP Users:

WordPress Me HTTP Mixed Content Error Fix Kaise Kare [Step By Step]

WordPress Ke Liye Top 5 Free Hosting Companies [For Newbie]

WordPress.com Serious Blogger Ke Liye Bekar Kyu Hai? 8 Reasons

WordPress Site Ki Performance Maintenance Ke Liye 7 Task Regular Kare

cPanel (FileManager) Me Htaccess File Show Kaise Karaye

More Posts from this Category

Recommended For You

YouTube Channel Me Subscribers Ko Hide Kaise Kare

10 Reasons Aap Online Business Me Success Kyo Nahi Hai

Blog Ke Categories Me Font Awesome Icon Kaise Kare

Backlinks Pane ke liye 20 Best Ways.

Blogger Template Download Karne Ke Liye Top 10 Trusted Websites

WordPress Me Maximum File Upload Size Ko Increase Kaise Kare [4 Methods]

YouTube Ke Top 10 Ranking Factors 2019

Blog me Text Selection Disable Karke Content Copy Hone Se Bachaye

Bank Branch Ka SWIFT Code Kaise Pata Kare? (Nahi Hone Par Kya Kare?)

Copyright © 2020 - All rights reserved.AboutContactSitemapDisclaimer