What would be the best way to build an Ad rotator? What would be the best way to build an Ad rotator similar to those we usually see around from http://fusionads.net for example.

WordPress have a plugin/widget for adding ads: https://wordpress.org/plugins/ad-rotator/

Basically it shows random HTML code every time you refresh the page. 

I was wondering how we can do that with Craft.
I built a plugin which does exactly this... Ad Wizard.

You can put your ads into groups, and add that group to your template like this:

{{ craft.adWizard.position('rightSidebar') }}


That code will automatically display a random ad from the group (unless it's disabled, expired, or over its maximum allowed impressions).

You can also target a single ad specifically, by referring to its ID number:

{{ craft.adWizard.ad(42) }}


The plugin also gives you built in ad tracking... You can add two chart widgets to your dashboard which will show you statistics on how your ads are doing.

If you need any help, feel free to contact support@doublesecretagency.com... All feedback, bug reports, and feature requests are welcome!