Jazajay
12-27-2007, 07:35 AM
Hi all.
I'm in the process of updating my tracking/product page and I was wondering if any one could notice or give me a better solution than what I have / want to do.
What I need is a more SEO friendly way of detecting if JS is turned off.
What I have at the mo is I set a JS variable to the link then test if the JS variable is on on the receiving page, if it is not JS isn't on.
However this has an obvious drawback, as I have recently noticed, namely the first page viewed wont have the JS URL parameter and always returns as a user has JS off.
I could test the refferer but I will either not enter any thing for that page into the DB or have to assume it is on, when it possibly couldn't be, and making my tracking less than perfect.
I have come up with 4 more solutions but these all have major drawbacks.
1. Create an image in JS with it's source pointing to a php page then set a session on that page. if JS is off the session is set to null then test the session.
2. Set a cookie in JS - test to see if the cookie is set
However for these to work the page must be refreshed, otherwise I have my orginal problem, as in via js redirect - not a way I really wont to go as it will refresh once for users but every page will refresh for the bots.
3. Test the second page and set the 1st page in a session then insert into the DB the JS value. However if I have a major problem with my non-js version and people leave my site because of it before clicking on I will not know of any problems and therefore wouldn't be able to fix them.
4. use get_browser however I for a long reason I cant as of yet use it.
The only practical solution seems to cloak the redirect and cookie any one have any better solutions before I have to implement this?
Hope you all had a good xmas
Thanks for reading
Jaza
I'm in the process of updating my tracking/product page and I was wondering if any one could notice or give me a better solution than what I have / want to do.
What I need is a more SEO friendly way of detecting if JS is turned off.
What I have at the mo is I set a JS variable to the link then test if the JS variable is on on the receiving page, if it is not JS isn't on.
However this has an obvious drawback, as I have recently noticed, namely the first page viewed wont have the JS URL parameter and always returns as a user has JS off.
I could test the refferer but I will either not enter any thing for that page into the DB or have to assume it is on, when it possibly couldn't be, and making my tracking less than perfect.
I have come up with 4 more solutions but these all have major drawbacks.
1. Create an image in JS with it's source pointing to a php page then set a session on that page. if JS is off the session is set to null then test the session.
2. Set a cookie in JS - test to see if the cookie is set
However for these to work the page must be refreshed, otherwise I have my orginal problem, as in via js redirect - not a way I really wont to go as it will refresh once for users but every page will refresh for the bots.
3. Test the second page and set the 1st page in a session then insert into the DB the JS value. However if I have a major problem with my non-js version and people leave my site because of it before clicking on I will not know of any problems and therefore wouldn't be able to fix them.
4. use get_browser however I for a long reason I cant as of yet use it.
The only practical solution seems to cloak the redirect and cookie any one have any better solutions before I have to implement this?
Hope you all had a good xmas
Thanks for reading
Jaza