View Single Post
Old 06-03-2010, 08:57 AM  
jawanda
Confirmed User
 
Join Date: Feb 2003
Posts: 6,040
Just tracking clicks? F-that, real stats nerds keep track of MOUSE OVERS with flash

If you like to obsess over click-through-rates, then you should also try keeping track of mouse-overs using flash. It is great fun for stats-nerds like myself, and gives you some real insight (when you see 200 mousovers on a button and only 4 clicks, maybe you need to tweak something). Obviously, flash is not always the best option for an "Ad", but there are instances where it can work well, especially when testing traffic quality (mouse-overs at least signify "real" users, even if they aren't clicking).

If anyone wants to play with this idea, here's how you do it:

Create two text files called mouseOverCount.txt and clickCount.txt.
Each one should contain the following text: "count=0" (Remove the quotes)

Create two php files called mouseOverCount.php and clickCount.php.

mouseOverCount.php should contain:

<?php
$count = file_get_contents("mouseOverCount.txt");
$count = explode("=", $count);
$count[1] = $count[1]+1;
$file = fopen("mouseOverCount.txt", "w+");
fwrite($file, "count=".$count[1]);
fclose($file);
print "count=".$count[1];
?>

clickCount.php should contain:

<?php
$count = file_get_contents("clickCount.txt");
$count = explode("=", $count);
$count[1] = $count[1]+1;
$file = fopen("clickCount.txt", "w+");
fwrite($file, "count=".$count[1]);
fclose($file);
print "count=".$count[1];
?>

Create your flash advertisement, use Actionscript 2.0 (under Publish Settings).

In the actionscript for your button(s), use:

on (rollOver) {
this.loadVariables("mouseOverCount.php?num="+rando m(99));
}
on (release) {
this.loadVariables("clickCount.php?num="+random(99 ));
getURL("http://www.YourDestinationUrl.com", "_blank");
}

Upload everything to the same directory (Swf+html, 2 txt files, 2 php files).

Change the Permissions on the TEXT files to 0666 (Read,Write for all Users).

Badda bing badda boom, point your browser at clickCount.txt and mouseOverCount.txt to see how many people have moused over and / or clicked on your buttons in flash!

-Phil
jawanda is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote