Quote:
Originally Posted by phillyhotshots
I have a website where people post links to products on Amazon, Overstock, etc. I'm looking for a script that will automatically recognize the retailer (store) and add my Affiliate ID accordingly. All of the user submitted URLs are currently stored by themselves in a table... although I don't know what is the best way to proceed.
Should I use .htaccess to send all links to a php file which adds the affiliate id and then redirects the visitor? Or should I create a script that automatically converts the link before its entered into the database?
Are there any free scripts that already do this?
|
Problem as I see it:
1) You need to identify(within the code) which website you are linking to, so that you can add the appropriate Affiliate ID for that site.
2) Then you will need to add the corresponding ID code to the link to match the site, and output the link correctly on your site so that when it is clicked your personal affiliate link will be added to the link.
2a) If you want it redirected automatically you could output a javascript redirect after the Affiliate ID is added.
My solution:
1) Create a database with (website_name,affiliate_id) in each record
2) I would use php to match the website domain name to your database
3) Pair each site Affiliate ID link(such as &ID=yourAmazonaffiliate) with the website name(amazon.com) in the database, and add the ID to the URI when the correct site is found.
So, if the link is:
http://linksynergy.overstock.com/fs-bin/statform?offerid=57189&bnid=1085&subid=0&CID=11949 3&keywords=tag+heuer+watches
Your php code would loop through the database searching for a string match until it finds your overstock.com database entry, then it would add your ID from the same database record to the end of the URI, so it would output to the screen:
http://linksynergy.overstock.com/fs-bin/statform?offerid=57189&bnid=1085&subid=0&CID=11949 3&keywords=tag+heuer+watches&id=12345678912
I guess I am just expanding on QualityEcommerce's answer after looking back at it.
Since your Affiliate ID for each site will be personal to you, this would have to be a custom database script.
Optionally, instead of outputting the link to the screen, you could save them in another database table, and draw from that when displaying the links.
Hope it helps!
markei
---------------------
no sig yet