Jump to content

PHP Code to detect External Outgoing Link Click


anks

Recommended Posts

Folks,

 

When someone click on a link on my webpage and if that Link takes the visitor off my site, then i want to make an entry in my database.

 

But if that link goes back to some other link in my Site then i do not want to Count that link.

 

So, is there any code that lets me detect any outgoing link Click?

 

Cheers

 

You'd need to run all links through a script that detects if the link is to a document in your page.

www.yourwebsite.com/out.php?l=encodedurlhere

Facebook does this, and I believe they use JavaScript to determine if the URL is external and if so adds a click event to that link that prevents the link from taking users to the direct location but instead redirects you through a script that probably logs the action.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.