This little script must track affiliate clicks and sales. No database should be used..
I will manually add the affiliates who promote my product to the script..
A txt file should be used to add affiliates.. This is where the affiliate data will be stored..
File should be like that:
{affiliate_e-mail} {affiliate_id} {number_clicks} {number_sales}
e.g.
user(at)email1 2000 297 9
user(at)email2 2001 124 2
.
.
user(at)emailx 200x x x
(affiliate with user_email2 has id=2000, 124 hits and 2 sales)
The id of the affiliate will be used in the affiliate URL e.g. for..
user(at)email1 2000 297 9
..the affiliate id is 2000 so the affiliate URL would be [login to view URL]
--
The script will have a single php page for affiliates with user e-mail and id to login and when you login it will only show affiliate clicks and sales..
The script will have a single php admin page with admin username and password and when you login it will ask for affiliate id.. When admin gives affiliate id the script will show one affiliate after the other in rows the following details:
{affiliate_username} {affiliate_id} {Number of Clicks} {Number of Sales} {Reset_affiliate}
e.g.
user(at)email1 2000 297 2 [RESET BUTTON]
user(at)email2 2001 190 2 [RESET BUTTON]
(id 2000 has 297 clicks and 2 sales)
There is an option to reset the clicks and sales for any affiliate ([RESET BUTTON])..
When click reset it should ask to confirm..
The script needs both 2CO and Paypal integration.. There will be a single product to promote..
The above means that in the sales page there will be a paypal button and a 2CO button.. When a visitor enters the sales page from an affiliate URL
e.g. [login to view URL]
the script identifies the affiliate id (2000) and credits a visit to the affiliate with that id.. If the visitor buys then the script credits a sale to that affiliate id..
E-mail send to both admin and affiliate when sale is made..
(Unicode encoding should be used to support greek chars in the subject and body of e-mail.. this part needs caution as it is important and usually confuses coders..)
So here how it should work..
Someone asks me to be an affiliate..
I manually enter their user_email and affiliate id in the txt file..
The affiliate uses their affiliate URL to promote my product
If someone clicks that URL a visit is counted for the affiliate
(A cookie is stored in the visitors PC)
If they leave the page ok the cookie is stored forever unless
the same user clicks a different affiliate URL (with different id)
If someone clicks the 2CO or Paypal button they go to the payment
processor.. If they finish transaction ok then return to thank_you
page and a sale is counted for the affiliate
Also an email is send to both admin and affiliate that there was
a sale made..
Email text should be hard coded in some php file and of course I
should be able to edit this manually..
--
affiliate goes to single php page enters e-mail and affiliate id and
view the number of clicks and number of sales..
Admin goes to single php page, enters username and password and
when page loads it shows all affiliates, one below the other e.g.
USER EMAIL -- affiliate ID -- NUM OF CLICKS -- NUM OF SALES -- RESET BUTTON
user1(at)[login to view URL] -- 2000 -- 297 -- 2 [RESET BUTTON]
user2(at)[login to view URL] -- 2001 -- 190 -- 2 [RESET BUTTON]
When admin click on [RESET BUTTON] all data for that affiliate is reset to zero..
Important: I should be able to edit the values in the txt file (e.g. the number of sales and clicks and user email and id)
When I enter a new affiliate I would use 0 as values for number of clicks and number of sales e.g.
user2(at)[login to view URL] 2000 0 0
--
That's all the script should do!
I repeat.. There will be one single product to promote! No product details needed
All data is stored in flat files.. Again, no DB should be used!