PDA

View Full Version : Non-Advertising popup dilemma


AskMeNoQuestions
27-07-2003, 12:08/12:08PM
Hi

On the site I'm developing, there are a lot of desired popup windows - these are viewer windows for an applet, which shows online tours of properties listed on the site. At present, I've got the popups as standard links, with a javascript onclick event handler to show the tour as a popup window if the browser has javascript enabled.

The only problem is, in most browsers (certainly with MSIE), no referrer info is sent with the request for the popup window. Many of the people listing on the site link to these popups from their own websites (this is OK, it's part of the raison d'etre of the site), and after search engines, most of the start pages for visits to the site come from these popup tours.

Obviously, it would be nice to track referrer info! Javascript doesn't support proper URI escaping in a built-in function, and you need version 1.2 or higher to escape the data properly (i.e. change '/' to '%2F', etc), and this is by writing your own function, so it's slower, is more complicated for clients of the website to add to their pages, etc.

The only way I can see to get round this, is by using a body onload function in javascript, to show the popup, and take the browser history back one in the original window, so that people can link to the tours without having to put any javascript in their pages. The referrer info is recorded, the link is a normal one and is spiderable (they are anyway), and if people viewing the page have popups turned off, they'll still see the tour, just in a normal window rather than a popup.

The question is, though, what happens in google with this kind of activity? Although it's a legitimate use of a popup, I can see that on surface it's not immediately distinguishable from an ad popup, at least as far as a computer scanning the page goes.

Does anyone have any knowledge of what the policy on this kind of thing is, or any alternative solutions? I'm dying to know!

AskMeNoQuestions
27-07-2003, 17:59/05:59PM
Whoa! Nobody's interested! Anyways, in case anyone *is*...

I found this out (after a ton of browser testing): different browsers and popup blockers do it in different ways, so you can't detect whether or not a popup has been successful in code. So, using the method I mentioned above in certain cases gives you a page that people can't view, because it sends the history back.

The workaround is to fetch a dummy file, and put window.location.opener into the query string (escaped however you can). Not ideal, but it's about the best solution I can see. I'll stick it up somewhere soon if anyone's interested!

Matt

ihelpyou
27-07-2003, 21:13/09:13PM
Hi Matt, Sunday's a bad day usually with everyone taking a day off. :)

I'm going to move this to a programming forum where someone may pick up on it there.