Solving Blogger Template Error for AdSense Ad Implementation

0
12
If you lot are of late enrolled inward AdSense too you lot are trying to implement advertizing code that you lot got from AdSense direct inward your Blog’s template you lot mightiness possess got encounter problems, nosotros volition walk you lot through fixing it.


If you lot are trying to add together code from AdSense which looks something similar this (there is a divergence betwixt the 2 codes, which nosotros volition explain)

Demonstration of the advertizing code inward Blogger template too the mistake that occurs
<script async src="//pagead2.googlesyndication.com/ pagead/js/adsbygoogle.js"></script> <!-- leaderboard --> <ins class="adsbygoogle"     style="display:inline-block;width:728px;height:90px"     data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"     data-ad-slot="1234567890"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> 

OR

<script async src="//pagead2.googlesyndication.com/ pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> 

The the solely divergence betwixt the 2 snippet is that the start ane displays an ad, whereas the minute ane is used solely to charge AdSense’s JavaScript files.

In many cases to improve page charge speed you lot merely desire to charge the scripts ane time because AdSense advertizing codes ever include the ad-block HTML code too equally the scripts. Or when you lot are enabling Page Level Ads the script tags needs to last added inward the template once, the next code is give, which you lot are supposed to implement inward your Blogger’s template / theme

The mistake that you lot mightiness last getting when trying to add together these code snippet inward your template is

Attribute scream “async” associated amongst an chemical component type “script” must last followed past times the ‘ = ‘ character. 

Fixing the error

There’s cipher incorrect amongst the code, according to HTML5’s measure it is an mistake complimentary code, but Blogger’s template / thee is coded inward XML too it fails to parse it because of a modest business office inward the codes
Right forthwith nosotros possess got (note that nosotros are solely displaying the business office of code that requires modification, residual should last left untouched),

<script async src="//pagead2.googlesyndication.com/ pagead/js/adsbygoogle.js [...] 

The work hither is that the “async” attribute has no values passed into it, for e.g “src” has a “=” sign amongst a value inward it. All nosotros require to practice is function past times a value to the attribute too Blogger volition bring it.

<script async="async" src="//pagead2.googlesyndication.com/ pagead/js/adsbygoogle.js [...] 

Notice the divergence betwixt the 2 snippets. We possess got laid it async="async", that makes it comply amongst XML so Blogger accepts it too saves the template without whatever error.

That’s pretty much everything to it. Follow the steps given higher upward too salvage the template, it must parse the code without whatever problems. If you lot are facing problems implementing ad-code other than this too then don’t hesitate to permit us know inward the comments (add a screenshot for ameliorate help)


Sumber http://www.stramaxon.com