So let’s say I’ve got this code
<a href="www.yourdomain.com"><img src="http://www.image.com/image.jpg" /></a>
Super simple code. Now let’s say that I give this code to my users as a B-B transaction. They can put this code ANYWHERE. Their site, ad space they bought, etc. Is there any sort of javascript code I can attach to it (or link to a php page and grab the referrer, then resend them perhaps?) so I can get some sort of notification?
So when people click on his version of the ad, I get some sort of notification?
So if I make it
<a href="www.MYdomain.com?theirdomain=www.blah.com" /><img></a>
I can grab “theirdomain” from the query string, and also forward them to “theirdomain”. Easy enough.
but now, now do I send “their domain” information to myself? What’s the best way to have that collected? < — end root of the question, I suppose
Let’s suppose one of your clients is http://www.foo.com.
You can give them this to place on their website:
<a href="http://www.mydomain.com/click_ad.php?domain=foo.com"><img src="..." /></a>On your website, you’ll want to include a click_ad.php file which inserts a value into your database stating that foo.com has had a user click on their version of the ad. You can find out how to do this here:
Reference: http://php.net/manual/en/book.mysqli.php
I would suggest you use one database table for the domains (and link them to an ID) and then another for the clicks (linking the domain IDs with the click amounts).