Using “hosted libraries” in ads running over adservers

Today I will be writing about the use of “hosted libraries”, ie the externally hosted resources (like the TweenMax used on my last article ) in banners. Usually we are quite limited in the production of standard ad in terms of the “weight” of the banner (ie the amount of data, typically measured in kilobytes). Every ad is shown many thousands of times, and of course all the data has to be transferred every time so that the amount of data we may use is limited by publishers and it is no wonder we are really happy about every bit of KB we can save on the production when it comes to their restrictions!
 
So it helps if we don’t have to deliver scripts like TweenMax “physically” within the ads or upload them to the adserver/marketer. Fortunately, we can take advantage of the scripts from various content delivery networks (CDNs), which we load in the head tag of our ads (they are for free, of course):
 

HTML inside Head:

<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/latest/TweenMax.min.js"> 
</script>

 
Usually you will find CDN links to mostly every scripts, such as Jquery, CreateJS, AdobeEdge etc.

 
It is important to always use a Secure connection, so the script should be loaded from a https:// source , otherwise the publishers may knock on your door with complaints. 🙂
 
I hope to have helped with this article and feel free to comment or write down any questions!