Welcome to WebmasterWorld Guest from 54.198.78.121
Forum Moderators: incrediBILL & martinibuster
Have been on AdSense for just over a week now and things are going fairly well, but I just received an email from Google telling me I've modified the code and suggested that I review their Program Policies.
I have my code set up as follows:
Displayed in the html:
<script type="text/javascript" src="/js/google.js"></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
And in the /js/google.js file:
<!--
google_ad_client = "XXX";
google_alternate_ad_url = "http://www.XXX.com/gfx/sp.gif";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//-->
I read in an earlier thread (which I can't seem to find right now) that we were allowed to run the code in external js files, but now I'm not so sure.
Ideas?
The difference is that you are splitting the AdSense code between your page and the js, and you are not permitted to alter the code in any way at all. The "http://pagead2.googlesyndication.com/pagead/show_ads.js" has to be together with the rest of the AdSense code.
The link above shows you how to do it correctly, which is Google approved, or at least approved as of a month ago.
<!--
google_ad_client = "XXX";
google_alternate_ad_url = "http://www.XXX.com/gfx/sp/gif";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_color_border = "B4D0DC";
google_color_bg = "ECF8FF";
google_color_link = "0000CC";
google_color_url = "008000";
google_color_text = "6F6F6F";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
//-->
I've tried numerous combinations, even the exact code provided in the other thread, and I consistently get an error on line 13 (src="http://...) and the banners do not display. It looks like javascript doesn't like it when I call another javascript file from within a javascript file because when I return the code to it's previous state (noted in the first post in this thread) there are no errors and the ads are served correctly.
Thoughts? =)
My site's built in straight html and rank well in the engines so I really don't want to have to change my file extensions or structure too much in order to get an include to work for these ads.
I've also found that if I change the colour scheme every once in a while it gives me a little boost in CTR, so it's be great to find a javascript solution that remains within Google's guidelines and is easily edited.
Any ideas here would be much appreciated. :)
document.write("\
<script type=\"text/javascript\">\
google_ad_client = \"XXX\";\
google_alternate_ad_url = \"XXX\";\
google_ad_width = 728;\
google_ad_height = 90;\
google_ad_format = \"728x90_as\";\
</script>\
<script type=\"text/javascript\"\
src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">\
</script>\
");
Andy
The code they provide doesn't run from external JS,
so the only change I made is making it to work.
(They have that weird mismatched /script tag which seems
to mess things up. Plus, the variables end up being
undeclared.)
I was worried about this, but then I saw the other thread
about running from external JS and I figured that whoever got it working, did exactly the same thing I did, and got approved.
Andy
I've emailed Google to ask if they approve.
If yes, we'll be able to use it, yay!
Andy
In an email I intricately described how and why I made the edits to the code, and then asked if there was an approved method of embedding the code through an external js file. To that I recieved a stock reply thanking me for changing my code back to stock... oh well, I was probably just having a nice conversation with their mailbot the whole time. LOL :D
Oh well.