Adding Adsense tags to photo captions to increase relevance Adding Adsense tags to photo captions to increase relevance
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Adding Adsense tags to photo captions to increase relevance

Started by lesault, October 03, 2006, 09:40:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

lesault

I've been hunting around the forums for information on adding Adsense code to my Coppermine 1.4.9 site. I think I've worked it out myself.

Adding the actual code:
  On the main page, I used xplicit's excellent advise: http://forum.coppermine-gallery.net/index.php?topic=29265.0
  On the thumbnail pages, I added the code using Mini-CMS (click the 'source' button and paste the adsense code in)

Relevance:
  The ads which are being served are all for Photo Printing, gallery hosting etc which is not what my site is about. The Adsense help pages at Google suggest adding
<!-- google_ad_section_start --> and <!-- google_ad_section_end --> tags around relevant content to increase the weighting of that content. Apparently it takes a few days for the change to take effect though.
  In order to add these tags around every caption, open include/functions.inc.php and make the following change.

Search for

        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\">".strip_tags(bb_decode($row['caption']))."</span>" : '';


Replace with

        if ($CONFIG['caption_in_thumbview']){
            $caption .= $row['caption'] ? "<span class=\"thumb_caption\"><!-- google_ad_section_start -->".strip_tags(bb_decode($row['caption']))."<!-- google_ad_section_end --></span>" : '';


Everywhere your caption appears it will now have the Adsense tags around it.

I hope this saves someone some time - I'll let you know when if the relevant ads start showing up!

You can see it in action at http://www.thepoltergeist.com
www.thepoltergeist.com - Are YOU brave enough?

lesault

It's taken 2 and a half days to make any difference, but I'm now not getting (so many) ads for photo printing services and gallery hosts. The ads look much better targeted to the sort of interests visitors to my site would have. Just need to get rid of the splash page and I'll be pretty happy with my site!
www.thepoltergeist.com - Are YOU brave enough?

jimboo