Support Forums

Integrating Adsense On Classifieds Sites

This is a discussion on Integrating Adsense On Classifieds Sites within the Site Marketing forums, part of the General category; Something to be aware of A. Classifieds Site - Homepage - AdSense Help Can't believe I never saw this before. ...


Go Back   68 Classifieds Forums > General > Site Marketing

Reply
 
Thread Tools Display Modes
Old 03-23-2011, 08:48 PM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default Integrating Adsense On Classifieds Sites

Something to be aware of

A. Classifieds Site - Homepage - AdSense Help

Can't believe I never saw this before. And with some minor customization it is achievable at the template level. I am at least hoping it enhances the revenue stream for adsense.

Here is an example I have put on an estate agents site for French property but the principle remains for general classifieds and the implementation.

Latest Listings For Property In France

And I know it is ugly but I will style it later nicely.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting

Last edited by seymourjames; 03-23-2011 at 09:03 PM.
seymourjames is offline   Reply With Quote
Old 03-23-2011, 09:30 PM   #2
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

It's funny that you mentioned it, I just saw it today as well when I was playing around in Adsense. I think this came out recently because I never saw it before, it is certainly an interesting approach and I will most likely adapt it as well.

Still thanks for sharing.
EnergyFreak is offline   Reply With Quote
Old 03-24-2011, 07:03 AM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

It turns out to be relatively simple to do when you know how on showlistings but there are some gotchas like getting adsense to appear on searchresults.php and empty categories, especially so if results pages are being excluded by robots.txt - I have worked out a way round that. In all it is not quite as straightforward as I was hoping but it is done now.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting
seymourjames is offline   Reply With Quote
Old 03-24-2011, 08:53 AM   #4
Customer
 
Join Date: Feb 2010
Location: Montreal, QC
Posts: 285
Rep Power: 12
EnergyFreak is on a distinguished road
Default

I was thinking of adding a {foreach} loop as suggested in previous posts. It would display Adsense every 5 ads in showlistings.php but I did not get it to work yet.
EnergyFreak is offline   Reply With Quote
Old 03-24-2011, 09:57 AM   #5
Developer & Moderator
 
 
Join Date: Jan 2007
Location: Pennsylvania, USA
Posts: 2,310
Rep Power: 69
Mike-N-Tosh is just really nice Mike-N-Tosh is just really nice
Default

That is new within the Google adsense help, however it isn't new to this forum and has been discussed a few times. Eric provided the code to integrate this within your showlistings template.

Code:
{if $smarty.foreach.foo.index % 5 == 0}
   Your ad code here
{/if}
Unfortunately, he didn't elaborate on the actual use of the code, so I will.
I haven't tried this with the showlistings.tpl template which is the default, only the showlistings2.tpl which is the one with the short description in it. Right after this line which starts the display of the individual listings.
{foreach from=$results item="entry" name="results"}
Put the first line of Eric's code:
{if $smarty.foreach.results.index % 5 == 0} <== replace "foo" with the foreach "from" name
Then put in your ad code. You should probably put the code within a div and add styling so that it matches your ad displays

After your ad code put this:
{else}
Then, leave all of the ad listing display code as is, but right BEFORE
{foreachelse}
End your if statement like this:
{/if}

*NOTE: The if statement actually counts itself in the index count, so you need to change the number to one more than the number of listing ads you want displayed before another display ad. So in the case you want to show it after 5 ads the first line should be % 6. Also, because the logic is set to == 0, this will show an ad first, then your listings, then another ad.

Have fun!!!
__________________
Mike-N-Tosh
IndianaPC.org - A community website (v3.1.10 Developer - heavily modified & used as the CMS)
Sandbox [localhost(v3.1.10, v4.0.9, 4.1.10,4.2,5.0)] for development and customization
Visit My blog: reviews, tips, tricks, tutorials and my store with Templates, Mods & Docs
Web Hosting | Web Design & Development | 68 Classifieds Customizations
I am not a 68C employee, just a user and try to help out
Mike-N-Tosh is offline   Reply With Quote
Old 03-24-2011, 10:30 AM   #6
curmudgeon
 
Join Date: Mar 2006
Posts: 5,411
Rep Power: 138
Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light Lhotch is a glorious beacon of light
Default

Quote:
Originally Posted by Mike-N-Tosh
*NOTE: The if statement actually counts itself in the index count, so you need to change the number to one more than the number of listing ads you want displayed before another display ad. So in the case you want to show it after 5 ads the first line should be % 6. Also, because the logic is set to == 0, this will show an ad first, then your listings, then another ad.

Have fun!!!

just use .iteration instead of .index
__________________
Larry

Knowledge learned is more valuable than knowledge given.
Lhotch is offline   Reply With Quote
Old 03-24-2011, 10:55 AM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 3,330
Rep Power: 83
seymourjames is a jewel in the rough
Default

You have to do a bit more than that Mike or you get problems with searchresults.php because google adsense cannot respond quickly enough to make good matching ads. Perhaps over time it can but in general searchresults should be excluded from being indexed anyway (their advice) via robots.txt. There is also the issue of the last page if it is not a full page of property ads. Best to put the code outside of the loop for that. Likewise no code in the foreachelse for the same reason as search results. It seems to make weird ads otherwise that are not about property in France (my target market) t or atleast it did not work well for me. I have adsense in the footer area anyway. For example,

The last page of properties in France for the area of Dordogne
Property Dordogne

A full page of French property in the same area
Property Dordogne 34

Here is the basic code I used because I have 8 listings of french properties and want it always show adsense after 4 listings and also at the end, if less than 4 properties, just at the end. In my case templatecodes provides a nice way to to test and exclude pages of search results because we malke all the script names available for SEO purposes amongst other reasons (the if test for search results)..

{foreach from=$results item="entry" name=foo}

{if $script_name <> "searchresults.php"}

{if $smarty.foreach.foo.index == 4}
<tr>
<td colspan="4">
<p align="left">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxx";
/* 728x90, created 23/03/11 */
google_ad_slot = "4485416383";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
</td>
</tr>
{/if}
{/if}

<tr> .....

{/foreach}
{if $script_name <> "searchresults.php"}
<tr>
<td colspan="4">
<p align="left">
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxx";
/* 728x90, created 23/03/11 */
google_ad_slot = "4485416383";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
</td>
</tr>
{/if}
</table>

P.S Larry - yes, you being the SMARTY man for sure - that works too. Makes it even simpler.
__________________
"The fool doth think he is wise, but the wise man knows himself to be a fool.".

TemplateCodes.com for 68C, Version 4 Templates & Modules
Get the Best U.S Hosting, Best U.K Hosting

Last edited by seymourjames; 03-24-2011 at 11:12 AM.
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
v4.0.x Google Adsense Classifieds Module - Free ombre Modules / Plugins / Modifications 13 02-01-2010 07:04 AM
How do I automatically feed a new classifieds site ads from major classifieds sites j890432m Modules / Plugins / Modifications 6 11-04-2009 03:25 PM
Let's see your Classifieds Sites greencode Technical Support 2 08-09-2008 11:23 PM
can i insert google adsense in 68 Classifieds Designer Unregistered Pre Sales Questions 1 07-16-2008 12:16 PM
Integrating Sites Chaslie Site Marketing 2 05-26-2006 11:36 AM


All times are GMT -4. The time now is 10:59 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2011, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0