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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tracking link clicks

Status
Not open for further replies.

realitybend

Programmer
Jun 24, 2008
2
US
I need to track how many users click on link A vs. link B. They both go to the same place.

Is this even possible?
 
You can do this a couple different ways...

1. Add a variable to each page and use your statistics/analytics to determine how many clicks each link gets.
Code:
<a href="page.html?link=A">Link A</a>
<a href="page.html?link=B">Link B</a>

2. If you are using a server-side language (PHP, ASP, .NET, Java, etc) you can add the variables to the links and add some code to add to a couple counters, either in a file or a database entry.

---------------
Jason

 
I need to do this in two places; one of them is on a page where clicking the link only calls a javascript function that makes a div visible (basically a popup). Is there any way to track which link made that visible?
 
for the div one you could use an AJAX call to a server side script as part of the process of toggling the DIV or set the URL in a hidden IFrame.

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top