-
AuthorPosts
-
July 15, 2018 at 2:23 pm #985649
Hello,
after reading all associated support topics I tried the following to display Google AdSense Ads:
I put this code 1 in the end of functions.php of child theme to embed code in head section of html:// insert adsense add_action('wp_head', 'wp_head_adsense'); function wp_head_adsense() { ?> <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({ google_ad_client: "ca-pub-my-costum-numbers", enable_page_level_ads: true }); </script> <?php }
I put this code 2 in normal text widget:
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <!-- my sitename - subname --> <ins class="adsbygoogle" style="display:inline-block;width:300px;height:1050px" data-ad-client="ca-pub-my-custom-numbers" data-ad-slot="my-costum-data"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> [wp_ad_camp_1]
I installed tthe plugin “Insert HTML snippet” and copied code 2 in its own widget.
I installed tthe plugin “WP Simple Adsense Insertion” and copied code 2 in its setting section. Then I published the shortcode [wp_ad_camp_1] in normal text widget.
No success at all. Frontend keeps white. What is going wrong?
Best regards,
Rolf- This topic was modified 6 years, 5 months ago by rolf2.
July 15, 2018 at 6:08 pm #985689Hey rolf2,
I tried adding your ad script to a footer widget and found that you are getting the error:Failed to load resource: the server responded with a status of 403
The 403 Forbidden error means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.
I then also tested on my localhost and got the same error.
Please check your Google adsence code, and the settings in your account.Best regards,
MikeJuly 16, 2018 at 9:35 am #985876Hi Mike,
thank you. You’re right. Google AdSense did not approve URL because website was in developement estate.
I will try to solve that.
Best regards
RolfJuly 17, 2018 at 3:02 am #986186Hi,
Glad to hear that you have an answer to the issue.
Unless there is anything else we can assist with on this issue, shall we close this then?Best regards,
MikeAugust 13, 2018 at 12:55 pm #996646Hi Mike,
yes, you can close this then.
Thank you for perfect support.
Best regards
Rolf -
AuthorPosts
- The topic ‘Can not display Google AdSense Ads’ is closed to new replies.