Forum Moderators: martinibuster

Message Too Old, No Replies

Using alternate ads to show relevant links for other pages

         

daugava

11:10 pm on Nov 9, 2003 (gmt 0)

10+ Year Member



Hi,

The other day I had an idea - since I have multiple sites,
why not use AdSense "google_alternate_ad_url" to do some
cross-advertising. That is, I'd look at my site URL and
show few links for other sections of the same site.

I figured this would be a simple task - I'd just point the
alternate_ad_url at an ASP page and inside the ASP, I'd
look at the URL of the page that runs the ad.

This way the alternate ads could be specific to the domain,
and thus relevant.

However, this is where I've encountered a problem: when I
access CGI variable SERVER_NAME, then instead of the
'current page URL', I am getting the 'URL of a page
where the alternate ad is hosted on'.

To illustrate, I am displaying a page from Server1, while
the alternate ad code is at Server2. When I try to figure
out which page the ad is being shown on, I am getting
Server2, but I want Server1, since this is how was planning
to target the alternate ads.

Any ideas?

Andy

linear

4:35 am on Nov 10, 2003 (gmt 0)

10+ Year Member



This isn't a tested solution or anything (but hey, free advice is worth what you pay for it). How about inspecting HTTP_REFERER?

zoltan

7:22 am on Nov 10, 2003 (gmt 0)

10+ Year Member



Just simply add a question mark to alternate URL and instruct your script to read that question mark.
For example: [alternateadurl.com...]

daugava

6:48 pm on Nov 13, 2003 (gmt 0)

10+ Year Member



Linear,

Thanks, that did the trick!
I'm a little embarassed that I missed that :)

Andy