I use redirect scripts on my sites for impression and clickthrough statistics. That works great with normal URLs, but some programs such as Amazon supply some affiliate links as an IFRAME, loading src from their site.

That means that it is much tougher to do outbound click-tracking. I was considering something like this...

When an IFrame ad is displayed, my server script would retrieve the iframe src and rewrite all of the anchor href's with my own redirect script URLs, making sure that the eventual destination URLs are intact. This sounds pretty safe from a commission tracking point of view, but I have two concerns...

1) All the iframe src requests to the merchant would originate from my server IP, not the customer's browser. This could break their impression tracking, depending on how it is configured. (I'm guessing this isn't an issue. Surely they would track impressions with a webbug pixel delivered as part of the iframe, right?)

2) Would this run afoul of any merchant's terms? It's not intended for any trickery. It's just stats tracking. I suppose this same issue would be applicable to Google AdSense, but their terms specifically prohibit changing the script. As far as I can tell, Amazon's terms do not.

Anyone have experience doing this?