phpstatisticstrackingvisitors

How to track sells you make by visitors referred by another website?


In my future website, I'll have partners and I want them to receive a certain percentage of money according to how much the visitors they sent me bought items.

So this is a simple question:

How to know where the visitor comes from when he decide to purchase a thing on my website so I give the correct amount to the partner who referred the member?

(i use the php Symfony framework, I guess it has nothing to do with, but anyhow... ;D )


Solution

  • Typically, this involves giving each partner some kind of unique ID, and then having them include that ID as a variable in the initial page they link to on your site. You then keep track of this ID in a session (either PHP's built-in sessions, or a cookie), and associate it with any purchases made. You can then go aggregate purchases by the associated partner ID to know who to give a cut.

    For instance, a partner might link to your site like this:

    http://www.your-example-site.com/some-product-page?referrer=QK117A4
    

    where QK117A4 is their unique ID.