Hi, I'm new the boards and a very novice web designer. I am looking to have one website redirect to another site but have the first site gather webstats (# of hits, what link ppl clicked on to get to that page, etc). Would a meta-refresh tag allow me to collect webstats such as Google Analytics? What would be the best way to go about collecting webstats and redirecting pages? Thank you guys for any help!
you can use something such as php to create and update stats in a database or in a file, then redirect to the new page
Would you mind telling us why you want to do a redirect in the first place? Redirects are not usually well regarded. You must have a very good reason for using a meta refresh redirect. Normal coding of web pages does not require using this device.
sounds like he is directing an old domain to a new one, but wants to see how many people are still going to the old one? just an idea this can actually be done with php referrer as well why not use google analytics? its great
I guess it would help to explain what I am trying to do... I'm trying to do internet marketing for companies. (I'm a marketer not a programmer so that's why I appreciate your help!) I am going to promote a company's website and I want to track how many hits I'm brining in. I'd like to be in control of viewing the webstats and not have the company add any code to its existing site. My idea was to have one of my sites just redirect to theirs and capture the stats. Not sure if this is the best way to do it though. Any suggestions from the pros out there??
You need to have a database record for every website you are promoting. Then, instead of linking to www.clientwebsite.com, you link to www.yoursite.com/out.php?id=clientid. The "out.php" script does the following: - locate the record that has the id = "clientid"; - increase the number of hits for this record; - redirect to the website stored in this record (www.clientwebsite.com).
Thank you so much! However, not being a programmer, I have no idea how to do any of that! Do you suggest I hire a programmer full-time or have a programmer set it up or should I just try to learn it myself since this will be an ongoing thing?
I don't know what to say. This task requires some php/mysql skills. It's up to you to decide what's the best option for you.
Your Google Analytics code should be something like this. <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-1482761-5"); pageTracker._initData(); pageTracker._trackPageview(); </script> Code (markup): So just add this at the bottom before the </script> document.location.href="http://yournewsite.com"; Code (markup): The final result should look like this. <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-1482761-5"); pageTracker._initData(); pageTracker._trackPageview(); document.location.href="yournewsite.com"; </script> Code (markup): This will run the google analytics script before redirecting, so should work. The problem is that some people do not have javascript enabled so for these few people, I would also include a text link that just says something like "Enter" in big letters. Hope this helps
I'm also looking for a redirect. Would this script work for an affiliate link? ie I don't want to loose sales and leads. thanks for posting the script.