|
How to place PopUp ads to maintain revenue level and reduce
the "annoyances"
PART II
[PART I] [PART II]
For php, you can use a include statement to include a page into another one:
include "header.php";
For ColdFusion codes, you need to implement this code in either the
Application or the endOnRequest page. Of course, you can use a template
include method similar to php and asp case, but it is much more convenient to
use them in the Application/endOnRequest pages since those are the default ones
CF will detect, so there's no need to insert the extra include code in your cfm
files.
Now onto the code structure itself. Below is the rough structure
written out in plain English and program language combined. Just copy the
same structure and you can easily integrate it into the appropriate code for
your page.
##Use an if statement to check to see if visitor has just entered your site
or if they're been surfing through at least one page already##
if (Visitor_SessionID) is defined
{
##Visitor_SessionID is established upon initial entrance to site, so if it's
already defined, this means your visitor is not a brand new visitor##
Visitor_Page_Counter=Visitor_Page_Counter+1;
}
else
{
##Visitor loads up the first page they visit on your site##
Visitor_SessionID = Assign( Session ID)
Visitor_Page_Counter=0;
LOAD Javascript AD code
}
That's it, a few simple lines of code. This way, your visitor will be given a
popup page ONLY upon their initial entrance, the rest of the journey on your
site will be popup-free! If you don't think it's a good idea to implement
the ad popup upon their initial entrance, and would rather have the popup come
out when they click on the second page on your site, then just modify the
combination of the if statement and the counter.
End of tutorial. :)
|