Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postioning a Counter on a Framed site, Referrers Problem

Status
Not open for further replies.

SteveAudus

Technical User
Oct 4, 2001
409
GB
Here is a little problem for all to solve,
that has had me stumped for a while... it must be told!

I will stop rhyming now....


I have a web site, and the index page is the frameset, loading up four pages into frames.

I have a counter that I'd like to place on the site, mainly to record the "Referrers",
(Where the vistors comes from),
I have tried placeing the counter in the noframes part of the index code, but it does work there because it does not load the counter.
But if I place it on any of the pages that the index page loads, then the couter only show that the referrer as the index page.

Please Help
Any suggestions.

Thanks

Steve Audus


 
My suggestion is not necessarliy going to be popular with you I think :)

I suggest you add an initial landing page that is just a single page. This is where you would put your counter (and catch all referrers). It's perfect for search engines as well... allowing them to index at least the first page of your site (and if you put some decent descriptions on there the search engines will be better able to index you properly).

It's also (often) a lower bandwidth option... since you load just the one html page (instead of a frame, then 4 pages simultaneously)... so your visitors get the value of knowing what they are connecting to before everything loads (could be more important to slow modem users maybe).

Anyway... there are other solutions - but this one makes sense for many reasons... and it's dead easy for you impliment *grin*

Jeff
 
Thanks for the suggestion,
but I'd thought of that.

I'm never keen on intro pages,
they are just one extra step that a vistor
has to go through before getting to the information they
require,

There must be another way, any other suggestions.

Cheers
Steve

 
Of course there are other ways (as I already mentioned)... I was just pointing out the most obvious solution - especially since you never mentioned you had rejected this in your original post.

Another solution requires you use some server-side code to insert the referrer information into a database (and maybe increment a counter) directly. You would perform this function before you even deliver the page to the user... so you will never miss recording a hit.

You might use PHP/mySQL for this... of course there are plenty of languages and databases... I mention php because so many hosting companies offer it now.

Jeff
 
Post some details on how you are triggering the counter!

Are you using something that's direct javascript? Maybe you are using the "request an image" technique (where extra parameters are appended to the image)?

With this information we will be better placed to offer alternatives on placement and use of the code.

Jeff
 
I would suggest putting that code directly after the initial <html> tag. Assuming that it doesn't write anything out to the page it'll be safe there.

Jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top