[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 176
  • Last Modified:

Unique Link Tracking

I have a team of lets say 10 people all of which are sales reps, there job is to get people to click on a link and sign up for a service. I'm trying to find out the best way to track this, I'm looking for a way to give each rep a unique URL link and all links go to the same page. So part one is how do i set that up, but the next hurdle is how do I retrieve that unique number so i know you signed up. I am using wordpress so if there is a plugin that always make life easier :) thank you for your responses.
1 Solution
Paul MacDonaldDirector, Information SystemsCommented:
Use a query string in the url with a unique identifier for each salesperson:


where s=123 means salesperson 123 is the referrer.
Jason C. LevineNo oneCommented:
For general use, the appending of a query string will probably be fine.  For Wordpress-specific use, check out the Affiliate plugin:

Sign your company up to try the MB 660 headset now

Take control and stay focused in noisy open office environments with the MB 660. By reducing background noise, you can revitalize your office and improve concentration.

DSTeamAuthor Commented:
Okay so lets say we use the query string method, example: www.mysite.com/signup?s=01
and i have assigned 01 to john doe. There is a referred by text box on the page so the goal is to auto fill that will John Doe. And if no string was added to the url it just puts in "Other" whats this javascript look like. Thank you again guys.
Paul MacDonaldDirector, Information SystemsCommented:
You're working in PHP, right?  I'd write the logic in PHP.  Unfortunately, I don't know PHP, so my usefulness ended with my first post.
DSTeamAuthor Commented:
This is how i get it
if( isset($_GET["s"]) ){ echo $_GET["s"]; }

Open in new window

I'm gonna have to create a table with ids and names
$con = mysql_connect('', 'root', '');
if (!$con)
  die('Could not connect: ' . mysql_error());

mysql_select_db("dbname", $con);

$sql="SELECT * FROM salesreps WHERE id = '".$s."'";

$result = mysql_query($sql);


Open in new window

This is how i set it

Open in new window

Sorry im just trying to work this out myself heres what i have but i think it needs to be cleaned up? thanks for the help!
DSTeamAuthor Commented:
Thank you paulmacd, youll be rewarded :)
Paul MacDonaldDirector, Information SystemsCommented:
Yes, sorry, my first post contained a link for working with query strings in PHP, so I didn't think to follow up with that.  

You will need to store the list of salespeople somewhere.  A database is ideal because it's easily updated.  If you can't have (or don't want) a database, consider a text file or something else external to the page itself you can update easily.  Having the list outside a particular page lets you use the list on more than one page, should the need arise.  Just something to consider.

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now