Did bit of search but thought i'd ask you guys as your always keen to help I've got a DB each user adds what albums they own... hoping adsense at the bottom will target the hundreds of key words on the page relating to music.. but its display adds about key loggers. this page of music is getting pulled from an ajax request. can google read that or what ?
Probably not. Ajax is difficult for search engines, so it is likely difficult to combine with adsense as well. Be very descriptive in your meta tags (including key-words) on pages like that.
My friend, after the Ajax script use the tag <noscript>Print same content on the ajax request here, at least the first request or the keywords</noscript> Code (markup): This could help, and don't forget the Meta Tags ...
You are not allowed to use Adsense on Ajax generated content, you can place a non-dynamic ads to which reflect the starting content, but thats as far as you can go. Peace,
The google-adsense bot will look at your page, desperately seeking info on what the page is about. So if you have an ajax page, where the subject isn't clear for the bot, thing like meta-tags and no-script text will be the only information it has to go on: and use it too.
Sorry, but I disagree. I have a website (see below) that is very similar in the way it works. It was veeeeery hard to figure out a way that will combine having AJAX working, and adsense that is related at the same time. But it is achievable. Please notice that the example below assumes you (want to) have 3 adsense blocks, 728x90, 250x250 and 160x600... changes to fit any design are as easy as ABC... In your <head> section, have something like: function _render(keyword) { var adspace1 = document.getElementById('ad_iframe1'); var adspace2 = document.getElementById('ad_iframe2'); var adspace3 = document.getElementById('ad_iframe3'); // reload ads in AJAX page adspace1.innerHTML = '<iframe src="getAdsense.php?kw='+keyword+'&w=728&h=90" border="0" frameborder="0" width="728" height="90">'+keyword+'</iframe>'; adspace2.innerHTML = '<iframe src="getAdsense.php?kw='+keyword+'&w=250&h=250" border="0" frameborder="0" width="250" height="250">'+keyword+'</iframe>'; adspace3.innerHTML = '<iframe src="getAdsense.php?kw='+keyword+'&w=160&h=600" border="0" frameborder="0" width="160" height="600">'+keyword+'</iframe>'; } Code (markup): The function above should be called after your AJAX part of the page rendering process has completed. Using moo.fx for example, they have a function called onComplete which starts after AJAX has completed its work, this is where we fire our function called _render with some related keyword. Now, the contents of the iFrame are pulled from a PHP script as you see above which is called getAdsense.php.. Here is the code for the getAdsense PHP script page.. <?php ini_set("display_errors", "off"); error_reporting(0); $keyword = $_GET["kw"]; $height = $_GET["h"]; $width = $_GET["w"]; /* Width & height are ANY VALUES accepted by the adsense program */ ?> <script type="text/javascript"> <!-- google_alternate_ad = "[B]http://xxxxxxxxxxxxxx[/B]"; google_ad_client = "[B]PUB-xxxxxxxxxxxxxx[/B]"; google_ad_width = <?=$width?>; google_ad_height = <?=$height?>; google_ad_format = "<?=$width?>x<?=$height?>_as"; google_ad_channel = "[B]xxxxxxxxxxxxxx[/B]"; google_color_border = "EAECEE"; google_color_bg = "EAECEE"; google_color_link = "1177AA"; google_color_url = "445563"; google_color_text = "445563"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <div style="display: none; visibility: hidden;"> <br /><br /> <h1><?=$keyword?></h1>, more about <h2><?=$keyword?></h2>.. read the latest <h3><?=$keyword?> articles</h3>, <h4><?=$keyword?> news and resources</h4> </div> Code (markup): So.. That getAdsense.php will load your adsense block code with the provided width and height.. and will also have a hidden DIV that contains some keywords related to what the end user sees in the adsense block.. i hope this makes some sense? finally, your template page.. Just where you want the ads to appear (that will reload with AJAX), make sure you change the adspace holder to look as follows.. <!-- Start Adsense 'Ajaxified' Dynamic Block --> <div id="ad_iframe[B]1[/B] (or 2, or 3 of course)"> [B]YOUR NORMAL ADSENSE CODE HERE[/B] </div> <!-- End Adsense 'Ajaxified' Dynamic Block --> Code (markup): Conclusion... The tweak above will do the following in a user's session.. When a user first visits the page, they see regular adsense block in 3 DIV spaces called ad_iframe1, ad_iframe2 and ad_iframe3 When the AJAX action takes effect (time to reload ads), a javascrip function is invoked which will reload the DIV's content from a PHP script. The PHP script will show a predefined-sized adsense blocks along with hidden keywords that will make sure the ads are relative to that content the AJAX part just rendered. Friends, i would have never explained it better that this.. i tried by best so good luck I have it working here at TheDamnCool.NET where you can see the code in action. If in anyway did this code help you, please leave me a greenie, good luck.
Thanks Wissam, i just felt the need to share something that took me too long to accomplish, and by the way gave good results