How to Implement Bitmedia JavaScript Placement Code on Your Website

This guide walks you through the entire process of adding Bitmedia ad units to your website, from obtaining your placement code to testing the ad on your live pages.

Step 1. Get the Placement Code from Bitmedia

Publisher units
  1. On the unit’s detail page, click “Get code”.
Units page
  1. Click “Copy” to copy your ad unit code to your clipboard.
Units page

Note: The code you copy looks similar to this example (for a 970x90 ad):

HTML / JS
<ins class="677f7f1b22502427bb3ebbe0" style="display:inline-block;width:970px;height:90px;"></ins>
<script>
!function(e,n,c,t,o,r,d){!function e(n,c,t,o,r,m,d,s,a){
s=c.getElementsByTagName(t)[0],(a=c.createElement(t)).async=!0,
a.src="https://"+r[m]+"/js/"+o+".js?v="+d,a.onerror=function(){
a.remove(),(m+=1)>=r.length||e(n,c,t,o,r,m)},s.parentNode.insertBefore(a,s)
}(window,document,"script","677f7f1b22502427bb3ebbe0",["cdn.bmcdn6.com"], 0, new Date().getTime())}();
</script>

Step 2. Paste the Code into Your Website

You can insert the Bitmedia placement code anywhere on your site where you want the ad to appear. Here’s how:

  • A. In-Article / Inline Ads

    Paste the code inside the <body> at the spot where you want the ad to be visible, usually between articles or content sections.

    Example:

    HTML / JS
    <article>
      <h2>Your Article Title</h2>
      <p>Some introductory text.</p>
    
      <!-- Bitmedia Ad Unit -->
      <ins class="YOUR-AD-CLASS" style="display:inline-block;width:970px;height:90px;"></ins>
      <script>
      /* Insert your Bitmedia script here */
      </script>
    
      <p>Continuation of your article...</p>
    </article>
  • B. Sidebar or Fixed Position Ads

    For sidebar or fixed ads, insert the code inside a dedicated <div>,and use CSS as needed for styling and positioning.

    Example:

    HTML / JS
    <div id="sidebar-ad">
      <ins class="YOUR-AD-CLASS" style="display:inline-block;width:300px;height:250px;"></ins>
      <script>
        /* Insert your Bitmedia script here */
      </script>
    </div>
    
    <style>
      #sidebar-ad {
        position: fixed;
        right: 10px;
        top: 150px;
        z-index: 1000;
      }
    </style>

    Replace YOUR-AD-CLASS and the style values with those from your copied code.

Step 3. Test the Ad

  • Save your changes and upload, if necessary, to your web server or hosting platform.
  • Open your website in a browser.
  • Verify that the Bitmedia ad displays correctly at the intended location.
    • Disable adblockers in your browser, as they may prevent your ad from appearing.

Tips and Best Practices

  • Place the script only once per placement. (Do not duplicate the same code on the same page.)
  • Do not alter the JavaScript or modify the class attribute.
  • For better visibility and higher CPMs , position ads higher on the page, such as near the top of articles or in the header/sidebar.
  • Always comply with Bitmedia’s Terms of Service regarding placement and visibility of ads.

Troubleshooting

If the ad does not appear:

  • Double-check your code placement.
  • Ensure you are not using an adblocker.
  • Allow a few minutes after adding the code (Bitmedia may take a little while to start serving ads).
  • Contact Bitmedia support if problems persist.