Advertisement

Tutorials

Home Tutorials Advanced Tutorial

Create Your Own "First Visit" Popup Window

1.0/5.0 (2 votes total)
Rate:

Shelley Lowery
December 22, 2004


Shelley Lowery

Shelley Lowery is the author of the highly acclaimed ebook series, Web Design Mastery -- an in-depth guide to professional web design that is rapidly becoming known as the "Bible" for professional web design. http://www.webdesignmastery.com

Shelley Lowery has written 6 tutorials for CGIDir.
View all tutorials by Shelley Lowery...

It's a proven fact that the use of popup windows is a highly effective marketing technique that produces great results. However, they can be very irritating to your visitors. How can you use this powerful marketing technique without offending your visitors? Compromise and use a popup window that only displays the first time your visitor enters your site.

Your first step in creating your popup window will be to create an HTML document that will contain your window contents. The key to using this technique effectively is to give your visitors a reason to respond to your offer. For example, if you're using your popup window to gain new subscribers to your publication, offer a free gift just for subscribing. This will increase your response considerably.

Below, is an example popup window that you can use to gain new subscribers. It is set up with "tables" and will adjust to fit your new window. Copy and paste the following code into your HTML and edit as needed:

<HTML>
<HEAD>
<TITLE>Claim Your FREE Gift</TITLE>
</HEAD>
<BODY BGCOLOR="#ffffff">
<CENTER>
<TABLE BORDER="0" CELLPADDING="2" ALIGN="Center">
<TR>
<TD BGCOLOR="red"><P ALIGN=Center>
<FONT face="Verdana,Helvetica" SIZE="3" color="white">
<B>Claim Your FREE Gift!</B></FONT>
</TD>
</TR>
<TR>
<TD><B><FONT face="Verdana,Helvetica" SIZE="3"><BR>
Subscribe to YOUR PUBLICATION for a wealth of information
to assist you in YOUR PUBLICATIONS SUBJECT. <FONT color=
"red">ALL new subscribers will receive YOUR FREE GIFT.
</FONT></FONT></B><BR>
<BR>
<FORM METHOD="POST" ACTION="YOURFORM.cgi">
<CENTER>
<TABLE BORDER="0" CELLPADDING="2" ALIGN="Center">
<TR VALIGN="Top">
<TD>
<INPUT type="text" name="email" value="[email protected]"
size="20" onfocus="value=''">
<INPUT TYPE="submit" VALUE="Subscribe"></TD>
</TR>
</TABLE>
</CENTER>
</FORM>
<P ALIGN=Center>
<BR>
<A HREF="javascript: self.close()"><FONT face="Verdana,
Helvetica" SIZE="2">Close Window</FONT></A><BR>
</TD>
</TR>
</TABLE>
</CENTER>
</BODY>
</HTML>

Save your new document as "popup.htm" and upload it to your server where you store your HTML documents.

Your next step will be to place the following script, courtesy of Brian Terry <secretwebriches.com>, within your HTML after your <BODY> tag.

<SCRIPT LANGUAGE="JavaScript">
<!--
function GetCookie(name) {
var arg=name+"=";
var alen=arg.length;
var clen=document.cookie.length;
var i=0;
while (i<clen) {
var j=i+alen;
if (document.cookie.substring(i,j)==arg)
return "here";
i=document.cookie.indexOf(" ",i)+1;
if (i==0) break;
}
return null;
}
var visit=GetCookie("COOKIE1");
if (visit==null){
var expire=new Date();
window.name = "thiswin";
newwin=open("popup.htm", "dispwin",
"width=350,height=350,scrollbars=yes,menubar=no");
expire=new Date(expire.getTime()+7776000000);
document.cookie="COOKIE1=here; expires="+expire;
}
// -->
</SCRIPT>

If you saved your new window document as anything other than "popup.htm," you'll need to change the "popup.htm" text within the script to your new file name. You can also change the width and height settings to whatever you'd like. However, make sure that all of the information within your window is visible.

Popup windows provide Internet marketers with a great way to gain new subscribers, introduce new products and announce special offers. Their response rate is outstanding. With the use of this great script, you can use the power of popup windows without continuously nagging your visitors.


Add commentAdd comment (Comments: 0)  

Advertisement

Partners

Related Resources

Other Resources

image arrow