Joomla's banner system lets you track clicks and impressions on image ads (GIF and JPG). But what about Flash? Even though iPad may be forcing a change in how much Flash advertisers use, it is still pretty common. So how do we track the clicks on a Flash ad? You can't simply upload your SWF to images/banners, select it when creating a banner, and be done with it. If you do that, the ad A) won't appear and B) won't track clicks. Here's our solution (this is for Joomla 1.5):
- Log in to Joomla and create a banner client and a banner in Components > Banner.
- After the banner's been saved, you can find the ID in the right-hand column of Components > Banner > Banners. Give this number to your advertiser along with this FLA file. They can then make their ad and export an SWF.
- After the advertiser sends you the SWF, upload it to images/banners and edit the banner, setting the custom banner code to point to the SWF. There are a number of ways to do this. Our preferred method uses AllVideos Reloaded, and is a small tutorial in itself.
Attached is a Flash (FLA) file that you can use with these instructions.
- If no banner client exists yet, create one: Components > Banner > Clients. Click New, add the requested details, and Save.
- Click Banners, or go to Components > Banner > Banners.
- Upload the banner image or Flash swf to /public_html/images/banners.
- At this point you can create a new banner from scratch (New), or select an existing one and Copy it. When copying, make sure to edit the banner’s settings to associate it with the correct client, and enable it (set Show Banner to Yes).
- Set the URL and other settings.
- Select the image/SWF from the pull-down menu (Banner Image Selector). You don’t need to set width and height.If using Flash, add Custom Banner Code as follows:{flashad width=”300″ height=”250″}your-ad-name.swf{/flashad}.
- The file name should match a file in /public_html/images/banners, and the dimensions need to match the Flash file’s actual dimensions.
- This method requires AllVideos Reloaded (click link for further instructions), and relies on a custom tag defined in Components > AllVideos Reloaded > Manage Tags / Presets. For iPad users and others requiring HTML5 instead of Flash, we will need to update the associated video player to support both HTML5 and Flash (see my other email about HTML5); stay tuned for details on how to do that.
- The Flash file contains a blank Button with a Hit area (4th frame inside the Button) covering the entire movie, which links to the banner ad’s unique ID, so that clicking the Flash ad will still track the click. The Button has this ActionScript code attached to it (hit F9 in Flash to view the code):
on(press){ getURL(“http://www.yoursite.com/index.php?option=com_banners&task=click&bid=1234″, “_blank”) }
.. where bid = this banner’s ID. You should save the banner, and then you can find its ID in the right column of Components > Banner > Banners.
I have attached a sample Flash file (FLA).