Avatar of ddantes
ddantes
Flag for United States of America asked on

Tracking visitor behavior

I have encountered a small issue with the solution to my related question.  When visitors to my website --  www.mauitradewinds.com -- click on the TripAdvisor menu button, the html code on page TripAdvisor.htm redirects them to an external site, but also allows me to track the page visit.  However, when the visitor's browser arrives at the external website, there is a Back button available.  Clicking that button reloads the same page, which could be irritating.  Is there a way to eliminate that active Back button?  I have tried using javascript, instead of plain html, to perform the redirection, with a function to auto-close the parent page, but there are other issues with that approach.  It doesn't work with most browsers, and may result in popup blocking.  
PHPJavaScriptHTML

Avatar of undefined
Last Comment
ddantes

8/22/2022 - Mon
Hugh McCurdy

I don't know a way for you to eliminate the back button.  

It sounds like your real problem is you don't want them ending up at http://www.mauitradewinds.com/TripAdvisor.htm and have them redirect them back to TripAdvisor.

If so, I suggest a PHP program that sets a SESSION variable/cookie.  If the cookie isn't set then the program behaves as it does now.  If it is set then it redirects the visitor to your home page (or if you get fancy the referring page on your site).

Does that sound good to you?
ddantes

ASKER
Thank you for your comment.  I am naive about PHP, so I'm not entirely clear on your suggestion.  The objective is to have the visitor reach the page on www.TripAdvisor.com, being directed there by www.mauitradewinds.com/TripAdvisor.htm, or some alternative page on my server (so that I can collect tracking information), and avoid a back button when they reach the ultimate URL.  If you have a cross-browser solution for that, please elaborate!
ASKER CERTIFIED SOLUTION
Hugh McCurdy

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ddantes

ASKER
Thank you for your patience in clarifying these concepts, which I jhave finally grasped.  In terms of simplicity, perhaps there is an easier way.  Previously I used a php file on my server to perform the redirection. I have embedded that file.  I posted a question in this zone, asking how I could insert javascript tracking code on that php page, and an expert advised me to replace the php approach  with my current html redirect page.  I accepted that recommendation, not anticipating the Back button issue. Now I am thinking of pursuing my original quest.  When the php file is loaded, and the redirect occurs, there is no active Back button on the broswer window; all that is lacking is the javascript tracking code.  If you could instruct me where to place the javascript so that it loads before the redirect occurs, perhaps that would be ideal. TripAdvisor.php
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
ddantes

ASKER
I took a shot at it.  Please check the embedded file and let me know if it needs any changes. TripAdvisor.php
SOLUTION
Ray Paseur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Hugh McCurdy

Ray, I wonder if it works for all browsers.  I had the same result (also using FF).  
Hugh McCurdy

I don't see anything seriously wrong with the file but it needs to be tested to be sure.   I suggest testing with IE and Chrome (neither of which is handy to me at the moment).

Wikipedia browser market share article   http://en.wikipedia.org/wiki/Usage_share_of_web_browsers

⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Ray Paseur

Hugh McCurdy

Thanks Ray.  I knew about that site from a class I took last spring and neglected to bookmark the URL.  Won't make that mistake twice.
ddantes

ASKER
Ray_Paseur: I don't see your click to the TripAdvisor page in my tracking report.  When you examined the code, did it appear that I inserted the tracking in the correct way?
Your help has saved me hundreds of hours of internet surfing.
fblack61