Forum Moderators: open

Message Too Old, No Replies

URL detection from AdSense Javascript

Is this possible?

         

Tonearm

3:51 am on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible to write some code that will determine what the domain of a Javascript AdSense link is on your own site? Mousing over one of the ads in IE will tell you what the domain is in the status bar at the bottom.

- Grant

jbot

3:33 pm on Jan 12, 2005 (gmt 0)

10+ Year Member



and why would you want or need to?

rocknbil

4:41 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Actually a friend and I went through this, although his request was to log what links they GO to from the site. His thinking was based on what the logs told him, he could block the lower paying ads.

We found no solution, and furthermore any futzing around with the AdSense code will get your account pulled.

Tonearm

4:43 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would want to so I can compile a list of companies I'm giving my traffic to. AdSense lets you *not* serve ads from certain sites (competitors) on your own site, but to do so effectively you would have to click on each and every one of your own pages and open the AdSense Preview Tool, click through the list of 12 ads, and add a URL to your blocked list when you find a competitor. That isn't practical, especially considering the fact that a new competitor could easily pop up as soon as you finish.

I need an automatically compiled and updated list of sites I'm giving my traffic to so I can block competitor's ads easily.

The problem is I don't know anything about Javascript. I've read it can cause problems on your site, and I've always ignored it until AdSense. I need to extract the domain info that shows up in the IE status bar when mousing over one of the ads from code like this:

<script type="text/javascript"><!--
google_ad_client = "my-number";
google_ad_width = 234;
google_ad_height = 60;
google_ad_format = "234x60_as";
google_ad_type ="text";
google_color_border = "000000";
google_color_bg = "FFFFFF";
google_color_link = "FF0000";
google_color_url = "AAAAAA";
google_color_text = "000000";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>

Can anyone point me in the right direction?

- Grant

Tonearm

4:45 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



rocknbil -

It seems like you should be able to get the domain info without "clicking" since IE shows it by mousing over?

- Grant

Sanenet

5:00 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See: [webmasterworld.com...]

Tonearm

5:18 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sanenet -

Cool thread, but different from what I'm after. They're trying to track all kinds of stuff, but all I'm after is the domain info that IE displays in the status bar so I can filter competitors.

Do any of you Javascript guys know how to extract that information?

- Grant

jbot

11:37 pm on Jan 12, 2005 (gmt 0)

10+ Year Member



Javascript can't read the contents of an iframe the URL of which the parent page doesn't originate. that cross site scripting is prevened for security reasons, so if Adsense uses iframes, then you're outta luck.

rocknbil

11:55 pm on Jan 12, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems like you should be able to get the domain info without "clicking" since IE shows it by mousing over?

You can, at that time. He (and probably you) was more interested in what URL's visitors were seeing and clicking.

The task is still the same, to find out what ads visitors are seeing (or clicking on) and using the AdSense tools eliminate undesirable ones from displaying on your site. I think it's set up so you CAN'T do that, giving the advertisers confidence that they'll have an equal shot at it. The code pushed out by Google and your page are both unwitting passengers in a page delivery and have no awareness of each other, there's no way to sniff out each other's content. (Why does Google display pertinent topical ads? That's a different process, if you check your logs you'll see visits from the Google spider.)

As far as I know - there's no way to do either with Javascript unless you diddle with the Google code, and that may be disastrous.