Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript errors from Google Adsense

On several of my adsense running sites, I have been getting the following errors:

Unable to post message to [http://]googleads.g.doubleclick.net. Recipient has origin http://www.anekdotz.com.

Unsafe JavaScript attempt to access frame with URL [http://]www.anekdotz.com/ from frame with URL [http://]googleads.g.doubleclick.net/pagead/ads?client=ca-pub-9099580055602120&output=html&h=250&slotname=9210181593&w=300&flash=10.0.42&url=http%3A%2F%2Fwww.anekdotz.com%2F&dt=1269901036429&correlator=1269901036438&frm=0&ga_vid=711000587.1269901037&ga_sid=1269901037&ga_hid=654061172&ga_fc=0&u_tz=-240&u_his=2&u_java=1&u_h=900&u_w=1440&u_ah=878&u_aw=1436&u_cd=24&u_nplug=10&u_nmime=101&biw=1365&bih=806&eid=44901212&fu=0&ifi=1&dtd=153&xpc=Xkfk1oufPQ&p=http%3A//www.anekdotz.com. Domains, protocols and ports must match.

(from the Chrome javascript console)

The ads seem to show properly and it doesn't affect my native javascript code. However sometimes these errors seem to slow down page loading. How can I fix this problem?

(I modified the URLs to let me post this as I'm a new user)

like image 773
Arjun Avatar asked Mar 29 '10 22:03

Arjun


People also ask

How do I fix AdSense problem?

Review the AdSense Program policies to make sure your site is in compliance. Keep in mind that we may review all pages of your site, not just the sign-up URL where you placed the code. After you've adjusted your content, sign in to AdSense and confirm that you've resolved the issues on your site.

Can Google AdSense be trusted?

Google AdSense is a family friendly network. Our publishers trust that the Google network will provide high quality brand advertisers, high cpcs and cpms, and coverage across a large number of topics. All of our policies are designed to ensure that we maintain both publishers' and advertisers' trust in our network.

How do you check if AdSense code is working?

A good way to verify that you've correctly implemented your AdSense ad code is to check the ad code in your browser's source code view: Open the page that contains the ad code in your browser, and then view your page's source code (e.g., in Chrome, right-click and select View page source or press CTRL + U).

What is the best way to format AdSense?

Create space for a leaderboard banner. Nothing quite gets the attention of your site's visitors like a large graphic at the top of the page. For most sites that want to optimize their AdSense earnings, that's a leaderboard banner at about 728 pixels wide by 90 pixels high. For some sites, it could be even larger.


1 Answers

Google have messed up their script. There's not much you can do about it.

For some reason http://pagead2.googlesyndication.net/pagead/expansion_embed.js, included in the parent page by the AdSense scripts, is trying to send information about the advert into a newly-written <iframe> created to hold the advert, using the new HTML5 postMessage facility:

            ha(this, function (f, e) {                 d[Pa](this.a[A]+"|"+f+":"+e, this.la)             }); 

Yeah. Some nice minified/obfuscated code there. Trust me, Pa is 'postMessage'!

The targetOrigin argument in this call, this.la is set to http://googleads.g.doubleclick.net. However, the new iframe was written with its src set to about:blank. This doesn't match the target origin, so the browser must refuse to send the message. Only Chrome seems to be dropping an actual whinge to the console log about it though.

No idea why it's doing this at all, never mind why it's not just using '*' as a target origin... I'm not really feeling like wading into the obfuscated script to find out. However, this error should not cause page loading to slow down. If you're seeing pauses it's usually resolving and fetching other external scripts.

like image 54
bobince Avatar answered Sep 20 '22 17:09

bobince