[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

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.  
0
ddantes
Asked:
ddantes
  • 5
  • 4
  • 2
2 Solutions
 
Hugh McCurdyCommented:
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?
0
 
ddantesAuthor Commented:
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!
0
 
Hugh McCurdyCommented:
I understand you want to avoid the back button.  I'm not sure you universally can.  You did with my browser because it opened a new tab.  But you wisely point out that you can't rely on that.  That's one reason I came up with the PHP solution.  The other being your question is posted in a PHP zone.

Before you can use PHP, your server must be configured for PHP.  Do you know if it is or can be?

I'll try to restate my original post.

The first time a particular user clicks on the Trip Advisor button (in his current web session), the PHP program would set a "marker" indicating that your website just saw that user.  Then it would direct them to Trip Advisor.  If the user showed up again, we could set the marker and direct him to a different page (such as your home page).  We might want to clear the marker so that if he again clicks on Trip Advisor, the marker is set.

This plan is a bit flawed in that funny things could happen if he has 2 windows open.


There might be other ways to do this using Referring Page but I'd want to test that before relying on that.


You would need a PHP programmer to do this work for you.  (You also need to make sure you have a PHP interpreter running or you can have one running.)



This approach might also work with Javascript but I don't know how that's done.

And you might be able to turn off the back button.  I just don't know how (if it's possible).  I'd doubt it would work in all browsers.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
ddantesAuthor Commented:
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
0
 
ddantesAuthor Commented:
I took a shot at it.  Please check the embedded file and let me know if it needs any changes. TripAdvisor.php
0
 
Ray PaseurCommented:
When I clicked the TripAdvisor link it opened a new browser tab (Firefox at current update level).  The "back" button is not active in the new tab.  This is a behavior that make sense to me, so I think you have a good common-sense solution.  Best regards, ~Ray
0
 
Hugh McCurdyCommented:
Ray, I wonder if it works for all browsers.  I had the same result (also using FF).  
0
 
Hugh McCurdyCommented:
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

0
 
Ray PaseurCommented:
0
 
Hugh McCurdyCommented:
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.
0
 
ddantesAuthor Commented:
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?
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now