Okay, I may have it... but won't know for sure until I get stats back.
METHODIn Amazon's affiliate area, you can create links to any product by using their redirect link.
So a link to this:
http://www.amazon.com/Family-Guy-Vol-Season-Part/dp/B000HT3P6U/ref=wl_gtwy_ty/104-6772149-0161532?%5Fencoding=UTF8&coliid=I4S9D64SV0IS8&colid=GWCWI0CVIG8D
Would become this:
http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2FFamily-Guy-Vol-Season-Part%2Fdp%2FB000HT3P6U%3F%255Fencoding%3DUTF8%26coliid%3DI4S9D64SV0IS8%26colid%3DGWCWI0CVIG8D&tag=AFFILIATECODE&linkCode=ur2&camp=1789&creative=9325
So replacing
http://www.amazon.com/with
http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http://www.amazon.com/
will redirect links
So what I did was the above, while also adding
&tag=AFFILIATECODE before the
&location=In
ubbthreads.inc.phpOn or around
Line 933, find:
$body = preg_replace( "#(\r\n|\r|\n)#i", "<br />", $body );
And afterwards place:
$body = str_replace("http://www.amazon.com/", "http://www.amazon.com/gp/redirect.html?ie=UTF8&tag=AFFILIATECODE&location=http://www.amazon.com/", $body);
Replace AFFILIATECODE with your Amazon.com affiliate code.
RESULTWhen using that redirect, the landing page becomes:
http://www.amazon.com/Family-Guy-Vo...32?_encoding=UTF8&tag2=AFFILIATECODEFirst off, the link works, so no harm/no foul. I will have to see if it actually counts because it does one thing: It changes
&tag=AFFILIATECODE to
&tag2=AFFILIATECODE
Amazon has usually been pretty good retrieving the AFFILIATECODE from the URLs, so let's hope this works despite the difference in tag name.
If that indeed works, I'll check for compatibility with Amazon.co.uk and Amazon.ca, etc, and create a tutorial here and at ubbdev.com
(Thanks to Gizmo for introducing me to str_replace
)