1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Rewrote Banner Delivery JavaScript

Discussion in 'Digital Point Ads' started by digitalpoint, Feb 14, 2014.

  1. #1
    I've been wanting to do this for awhile, and since I had to rewrite parts of it for the new responsive ad support, I decided to just rewrite it from scratch.
    • Eliminated all use of document.write(). It now creates DOM elements directly.
    • Wrapped the whole thing in anonymous function (so it can't taint other JavaScript variables on site).
    • Builtin easing animations so doesn't need to load animation JavaScript when it needed it.
    • Uses jQuery.noConflict() now.
    • Ad code is done by adding an <ins> HTML tag with data attributes for ad settings (no need to set JS variables).
    • The fallback system where it can show AdSense ads if there's not a Digital Point Ad to display is *much* less complicated internally now that we switched to using AdSense's async code (it was very kludgey getting non-async code to work as async before).
    • Async AdSense code used now is able to handle multiple ad units on a single page.
    • Ad delivery JavaScript is much smaller now (8.4KB vs. 13.7KB before).
    I'd highly suggest utilizing the new ad code, which can be generated here: https://advertising.digitalpoint.com/publisher?action=formats
    SEMrush
    Oh yeah, I also made the selection of fallback AdSense ad units cake if you have a linked AdSense account here. It will pull your ad units on your AdSense account (that are responsive) and lets's you just pick which one to use by clicking it. For example...

    upload_2014-2-14_1-28-19.png
     
    digitalpoint, Feb 14, 2014 IP
    SEMrush