I have a feed that displays adverts on my website. They are up to 10 adverts displayed at any one time. Currently, if you click on any of the adverts, it will take you to somewhere specified by $ad['CLICKURL'] in the code below. However, I want to put in an intermediate step so that I can track: the date the link was clicked; which advert was clicked e.g. pos1 or pos3 etc; which target market was clicked.
So, I figure I have to pass these variables across by tacking on:
?position=$key&targetmarket=clothes etc.
...to the CLICKURL.
But also, do I have to tack on the CLICKURL too? I was thinking about having an intermediate PHP page with a redirect, that will populate a MySQL db with the data.
How can I modify the code to do this? (I want to keep the foreach structure as it does other stuff too).
Thanks,
Jon
$myfeed = new feedXmlClient(17, STD_MODE, 10, $ip_addr, $ref, $debug, $keyword);
blah blah...
foreach($myfeed->ads as $key => $ad)
{
if($key == 0) {
blah blah...
echo "<span class='nx-title'><a href='{$ad['CLICKURL']}'>{$ad['TITLE']}</a></span></br>";
blah blah...
}
elseif($key == 1) {
blah blah...
echo "<span class='nx-title'><a href='{$ad['CLICKURL']}'>{$ad['TITLE']}</a></span></br>";
blah blah...
}
elseif($key == 2) {
blah blah...
echo "<span class='nx-title'><a href='{$ad['CLICKURL']}'>{$ad['TITLE']}</a></span></br>";
blah blah...