Nick Ginanto
Nick Ginanto

Reputation: 32130

Keep track on referrered links

Many sites have this implemented, I don't know how exactly it is called so its hard for me to search for it

you can see links in websites such as facebook,twitter that have urls similar to

www.website.com/some-article?ref=home

so in this case, the back-end will take note that the link was clicked from the home page and keep track of this

my question is - is there a known practice / knowledge on how this needs to be done or do I just need to insert my own ref parameters and keep track of this manually?

Upvotes: 0

Views: 95

Answers (1)

Divanshu
Divanshu

Reputation: 426

You can do this manually. It's very easy to implement. Most website like facebook and twitter use this to track what their users generally do. This is kind of silent survey that is used to provide better user experience.

It is also used in search engines such as Google to track where the traffic for particular hit comes from. You will know this better if you have a Google blogspot blog.

But, there is no limit to innovation. You can use it in whichever way you want.

In PHP, you can use $_SERVER['HTTP_REFERER"]

session_start();
if ( !isset( $_SESSION["origURL"] ) )
     $_SESSION["origURL"] = $_SERVER["HTTP_REFERER"];

Sorry, I don't know ruby. There should be pre-written libraries to help you in this, but I don't know about any. You can create your own library for this. It will provide better control.

Upvotes: 1

Related Questions