Google Answers Logo
View Question
 
Q: Gateway autoforwards to main page but back button forces users into endless loop ( No Answer,   0 Comments )
Question  
Subject: Gateway autoforwards to main page but back button forces users into endless loop
Category: Computers > Programming
Asked by: cclegg06-ga
List Price: $20.00
Posted: 30 Jul 2003 07:23 PDT
Expires: 02 Aug 2003 07:02 PDT
Question ID: 236917
I have a site that uses gateway pages to track where visitors are
coming from.  For example, a visitor from Where2Go will click on the
link http://www.surveylab/cpc/?source=where2go and be automatically
redirected through a JS to the main home page
http://www.surveylab.net.

I use the “surveylab.net/cpc” gateway to monitor my traffic through
tracking code on that page.

My problem is that when someone gets to http://www.surveylab.net
through the auto forward and hits backspace, they go to the gateway
page which sends them back to the main page and they’re stuck in an
endless loop.  This is a problem both for accurate tracking, causes a
poor user experience, and is a violation to some CPC search engines
(Google AdWords for one).

How can I fix this?  How can I set things (modify the code…) so a
visitor who is passed through a gateway page with an automatic forward
can hit the back-space button (once at the final destination page) on
their browser and get back to the original referring page, skipping
the gateway.

My current gateway code is below:

<script LANGUAGE="JavaScript" FOR="window" EVENT="onload()">
<!--
var an = navigator.appName;
var av = navigator.appVersion;
if (an.indexOf("Microsoft") >= 0)
	window.location="http://www.surveylab.net";
else
	if (an.indexOf("Netscape") >= 0)
	window.location="http://www.surveylab.net";
else
	window.location="http://www.surveylab.net";
//-->
</script>

Not sure if the fix comes from modification to the gateway code or a
new JS script on the final destination page telling to go to the page
before the gateway.

Thanks for your help,

Chris

Request for Question Clarification by sycophant-ga on 31 Jul 2003 07:37 PDT
Hi cclegg06,

I thought this should be relatively easy, but my computer is playing
up and my tests are not behaving as I think they should.

Try adding the following before the redirections:

var ne = history.next;
if (ne.indexOf("surveylab.net") >= 0)
 history.back()

The idea being, that if the user has hit the back button and got to
the redirector page, then the value of history.next will contain your
site. If it does, then you simply step back another step in the
history.

However my javascript reference maybe a little dated, as I am having
trouble with this. Or my browsers are toying with me, which is just as
likely.

Let me know if this works for you.

Regards,
Sycophant-ga

Clarification of Question by cclegg06-ga on 31 Jul 2003 09:30 PDT
sycophant-ga,

Thank you for your time.  Sorry, it didn't work.  I tested your code
at: http://www.surveylab.net/test. The complete HTML test code is
below.  Your code begins on line 52.

Thanks,

Chris

---

<html>
<head>
<title>Survey Lab</title>
<link rel="stylesheet" href="../../inc/style.css">
<table cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<td valign="top" colspan="2">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td><a href="../../index.php">
                    <img src="../../images/header_start.gif"
border="0" width="639" height="152"></a></td>
					<td background="../../images/top_stretch.jpg" width="100%"></td>
					<td><img src="../../images/header_end.gif" width="153"
height="152"></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td valign="top" colspan="2">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td><a href="#" onclick="javascript:window.open('about_us.php',
'_blank', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,resizable=yes,width=600,height=600,top=50,left=50');">
                    <img src="../../images/about_us.gif" border="0"
width="120" height="32"></a></td>
					<td><a href="#" onclick="javascript:window.open('privacy.php',
'_blank', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,resizable=yes,width=600,height=600,top=50,left=50');">
                    <img src="../../images/your_privacy.gif"
border="0" width="107" height="32"></a></td>
					<td><a href="#" onclick="javascript:window.open('affiliates.php',
'_blank', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,resizable=yes,width=600,height=600,top=50,left=50');">
                    <img src="../../images/affiliate.gif" border="0"
width="95" height="32"></a></td>
					<td><a href="#" onclick="javascript:window.open('help.php',
'_blank', 'scrollbars=yes,toolbar=no,location=no,directories=no,status=no,resizable=yes,width=600,height=600,top=50,left=50');">
                    <img src="../../images/help.gif" border="0"
width="107" height="32"></a></td>
					<td><a href="mailto:admin@surveylab.net?subject=I have a few
questions/ comments... See below">
                    <img src="../../images/contact_us.gif" border="0"
width="112" height="32"></a></td>
					<td width="100%"></td>
					<td><img src="../../images/menu_end.gif" width="153"
height="32"></td>
				</tr>
			</table>
		</td>
	</tr>
<tr>
		<td valign="top" colspan="2">
			<table cellpadding="0" cellspacing="0">
				<tr>
					<td width="100%"></td>
				</tr>
			</table>
		</td>
	</tr>
<tr>
</head>

<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0">

<!-- Begin back skip gateway script -->
<script language="javascript">
var ne = history.next;
if (ne.indexOf("surveylab.net") >= 0)
 history.back()
</script>
<!-- end back skip gateway script -->

<!-- Begin filename-querystring script -->
<script language="javascript">
function _gf(x){return x.substring(x.lastIndexOf("/")+1,x.length);};
var home_page_name = "test"; // sets the name of the default page
function _gf(x){return x.substring(x.lastIndexOf("/")+1,x.length);};
var filename_and_query = _gf(location.pathname) + location.search;
if (filename_and_query==""){(filename_and_query=home_page_name);}
</script>
<!-- end filename-querystring script -->

<!-- webbot bot="HTMLMarkup" startspan -->
<!-- BEGIN WEBSIDESTORY CODE -->
<!-- COPYRIGHT 1997-2001 WEBSIDESTORY, INC. ALL RIGHTS RESERVED.
U.S.PATENT PENDING. Privacy notice at: http://websidestory.com/privacy
-->
<script language="javascript">
var _pn=filename_and_query;    //page name(s)
var _mlc="/TEST";  //multi-level content category
var _cp="null";   //campaign
var _acct="XXX"; 	//account number(s)
var _pndef="title";  //default page name
var _ctdef="full";   //default content category
var _prc="";   //commerce price
var _oid="";   //commerce order
var _dlf="";   //download filter
var _elf="";   //exit link filter
var _epg="";   //event page identifier
var _mn="wp179";			//machine name
var _gn="phg.hitbox.com";			//gateway name
var _hcv=68;function
_wn(n){return((n.indexOf("NAME")>0&&n.indexOf("PUT")>-1)||
(n.indexOf("CONTENT")>-1&&n.indexOf("CATEGORY")>0))};function
_gd(x,w){var _ed=
x.lastIndexOf("/");var
_be=(w!="full")?x.lastIndexOf("/",_ed-2):x.indexOf("/");
return(_be==_ed)?"/":x.substring(_be,_ed);};function _gf(x){return
x.substring(
x.lastIndexOf("/")+1,x.length);};function _tc(_ml){var
_mll=_ml.length-1;var s=
"/";if(_ml.lastIndexOf(s)==(_mll-1)){_ml=_ml.substring(0,_mll-1)}if(_ml.indexOf
(s)!=0){_ml=s+_ml;_mll++}if(_mll){var
a=_ml.substring(1,_mll).indexOf(s);if(a==
-1)return _ml;var b=_ml.substring(a+2,_mll).indexOf(s);if(b==-1)return
_ml;if(b
!=-1){if(!b)b--;return _ml.substring(0,a+2+b);}};return _ml;};var
_hl=location;
var _lp=_hl.protocol.indexOf('https')>-1?'https://':'http://';var
_zo=(new Date
()).getTimezoneOffset();function
_ps(_ip,_pml){return(_ip&&_wn(_pml))?((_pndef
=="title"&&document.title!="")?document.title:_gf(_hl.pathname)?_gf(
_hl.pathname):_pndef):_tc(_wn(_pml)?_gd(_hl.pathname,_ctdef):_pml)};function
_pm(m,_fml,h){if(m.indexOf(";")!=-1){_nml=m.substring(0,m.indexOf(";"));_rm=
m.substring(m.indexOf(";")+1,m.length);_fml+=_ps(h,_nml)+";";return
_pm(_rm,
_fml,h);}else{return _fml+_ps(h,m);}};var _sv=10;var _hn=navigator;var
_bn=
_hn.appName;if(_bn.substring(0,9)=="Microsoft"){_bn="MSIE";};var _bv=(
Math.round(parseFloat(_hn.appVersion)*100));if((_bn=="MSIE")&&(parseInt(_bv)==2
))_bv=301;function _ex(v){return escape(v)};var
_rf=_ex(document.referrer);
_mlc=_pm(_mlc,"",0);_pn=_pm(_pn,"",1);</script><script
language="javascript1.1">
_sv=11;</script><script defer src="http://stats.hitbox.com/js/hbp.js"
language="javascript1.1"></script><script
language="javascript">if(_sv<11){if(
document.cookie.indexOf("CP=")>-1){_ce="y";}else{document.cookie="CP=null*;
p"+
"ath=/; expires=Wed, 1 Jan 2020 00:00:00
GMT";_ce=(document.cookie.indexOf(
"CP=")!=-1)?"y":"n";};if((_rf=="undefined")||(_rf=="")){_rf="bookmark";};_x2=
"<img src='"+_lp+_gn+"/HG?hc="+_mn+"&hb="+_ex(_acct)+"&n="+_ex(_pn);_x3="&cd="+
"1&hv=6' border=0 height=1
width=1>";_ar="&bn="+_ex(_bn)+"&bv="+_bv+"&ce="+_ce+
"&ss=na&sc=na&ja=na&sv="+_sv+"&con="+_ex(_mlc)+"&vcon="+_ex(_mlc)+"&epg="+_epg+
"&hp=u&cy=u&dt=&ln=na&cp="+_ex(_cp)+"&pl=&prc="+_ex(_prc)+"&oid="+_ex(_oid)+""+
"&rf="+_rf;document.write(_x2+_ar+_x3);}document.write("<\!--");</script>
<noscript><img
src="http://phg.hitbox.com/HG?hc=wp179&cd=1&hv=6&ce=u&hb=xxx&n=test=/TEST"
border='0' width='1' height='1'></noscript><!--//-->
<!--  END WEBSIDESTORY CODE  -->
<!-- webbot bot="HTMLMarkup" endspan -->





<script LANGUAGE="JavaScript" FOR="window" EVENT="onload()">
<!--
var an = navigator.appName;
var av = navigator.appVersion;
if (an.indexOf("Microsoft") >= 0)
	window.location="http://www.surveylab.net";
else
	if (an.indexOf("Netscape") >= 0)
	window.location="http://www.surveylab.net";
else
	window.location="http://www.surveylab.net";
//-->
</script>
<table cellpadding="0" cellspacing="0" width="100%" align="center">
	<tr>
		<td valign="top">
			<table cellpadding="0" cellspacing="0" width="322">
				<tr><td><img src="../../images/5_minutes.gif" width="322"
height="157"></td></tr>
				<tr><td>&nbsp;</td></tr>
				<tr>
					<td align="center">
						<table cellpadding="0" cellspacing="0" width="275">
							<tr>

                <td>Scroll Down and take our short&nbsp; Survey - and
we
                  will send you a 50 minute calling card. It's as
Simple as that.
                </td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
		<td width="100%" valign="top">
			<table cellpadding="3" cellspacing="1">
				<tr><td><p><br>
              Welcome to SurveyLab!<br>
              <br>
              We're locating a survey for you now.  Please wait while
we
              transfer you to our live servers!</p>
            <p>If you are not transferred automatically, please <a
href="http://www.surveylab.net"><em>click
              here</em></a></p></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</html>
Answer  
There is no answer at this time.

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy