Sunday, July 31, 2016

How to add bidvertiser javascript ad codes in the middle of blog post or any where inside blog post | Blogspot blogger trick




Bidvertiser is an advertising network like Adsense.Unlike adsense it is very easy to get approval on bidevertiser. Bidevertiser ads can work along with adsense or any other ad networks that you use already.For me it was the best adsense alternative.

How to add Bidvertiser code to your blogger 

Step 1 : Add HTML/JavaScript gadget to your blogger


You can skip this step if you alreay have a HTML/JavaScript gadget installed in your blog.

Step 2 : Paste in the ad code from the bidevertiser code into the Content section of your HTML/JavaScript gadget


Before adding you should put the code inside a div with id "adnew" and a span of id script_code
For example my adcode from bivertiser was

<!-- Begin BidVertiser code -->
     <script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=436127&bid=1808751"     type="text/javascript">
     </script>
<!-- End BidVertiser code -->   

and I have edited it inside

<div id='adnew'>
<span id='script_code'>
      
<!--  THIS SHOULD BE REPLACED WITH YOUR CODE-->   


  </span>
  </div>

Now the whole thing will look like

<div id='adnew'>
<span id='script_code'>
      
<!-- Begin BidVertiser code -->
     <script src="http://bdv.bidvertiser.com/BidVertiser.dbm?pid=436127&bid=1808751"     type="text/javascript">
     </script>
<!-- End BidVertiser code -->   


  </span>
  </div>


Now Open Your HTML/JavaScript gadget and paste your edited ad code. After this the ad will begin to appear in the HTML/JavaScript gadget of your blog.

Now we want to display it n the blog post.
For that we should programmatically copy the adcode to the place we want to display ads.



Step 3 : Paste the below code to your currently active template

The below code will grab the ad content from HTML/JavaScript gadget and put them inside the blog post.

<script>
var script_code=$(&quot;#adnew&quot;).html();
script_code = script_code.replace(&quot;&lt;script&quot;, &quot;&lt;!--script&quot;);
script_code = script_code.replace(&quot;script&gt;&quot;, &quot;script--&gt;&quot;);
$(&quot;.replacead2&quot;).html(script_code);
$(&quot;#adnew&quot;).hide()
</script>


Step 4 . Display ads inside blog posts.

Edit your template and find  the position where you need to put your ad.Then paste the below code there.
 
<div class=' replacead2'>
</div>


Now the ad will start displaying where you add this code.

Thanks for reading and feel free to comment below if you have any doubts.