Sunday, October 29, 2017

How to copy paste the code from adSense blog html.

If you have your own domain name and include in blog already, and want to copy paste the code in your own hosted adSense, just follow as mention below.

You will try to copy paste the Code generate from adSense but the html will give an error. That error is with generated code.

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-8654552630647779",
    enable_page_level_ads: true
  });
</script>

Above highlighted in yellow text is code generated from adsense. There is a mistake in code. In first line, i have mark red line. They have forgot to close the script with >.  Below is the code adding the missing > as shown.

<script >async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-8654552630647779",
    enable_page_level_ads: true
  });
</script>


Hope it will help you.

No comments:

Post a Comment