Google adsense in topic.asp - Posted (9038 Views)
Starting Member
dl4gbe
Posts: 36
36
Hello.
Here an example to add adsense in topic.asp



Add the folllowing function to topic.asp
please do not forget to set your own ID in
google_ad_client

Code:


sub Adsense(strColorBG)

Response.Write " <tr>" & vbNewLine & _
" <td bgcolor=""" & CColor & """ valign=""top"" width=""" & strTopicWidthLeft & """>" & vbnewline
Response.Write " <p><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b><span class=""spnMessageText"">Google Adsense</span></font>" & vbNewLine
response.write " <p><font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>USA</small></font><br />" & vbNewLine & _
" <font color=""" & strForumFontColor & """ face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """><small>Mountain View</small></font></p></td>" & vbNewLine


Response.Write " </td>" & vbnewline & _
" <td bgcolor=""" & CColor & """ height=""100%"" width=""" & strTopicWidthRight & """"
if lcase(strTopicNoWrapRight) = "1" then Response.Write(" nowrap")
if (AdminAllowed = 1) and (maxpages > 1) then
Response.Write (" colspan=""3"" ")
else
Response.Write (" colspan=""2"" ")
end if
Response.Write "valign=""top"">" & vbnewline

Response.Write " <table width=""100%"" height=""100%"" border=""0"" cellspacing=""0"" cellpadding=""0"">" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""top"">" & vbNewLine


strColor = strColorBG

if (left(strColor,1) = "#") then
strColor = mid(strColor,2)
end if

%>

<script type="text/javascript"><!--
google_ad_client = "xxxxxxxxxxxxxx";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = "468x60_as";
google_ad_type = "text";
google_ad_channel ="";
google_color_border = "<%=strColor%>";
google_color_link = "0000FF";
google_color_bg = "<%=strColor%>";
google_color_text = "000000";
google_color_url = "008000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

<%


Response.Write " </td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" <tr>" & vbNewLine & _
" <td valign=""bottom"" align=""right"" height=""20""><a href=""#top"">" & getCurrentIcon(strIconGoUp,strLangTopic00200,"align=""right""") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _
" </table>" & vbNewLine & _
" </td>" & vbNewLine & _
" </tr>" & vbNewLine

end sub




at the beginning of the file declare one variable.
Code:

bolShowAdd = true


At the end of the big reply loop
bevor the next insert this.

Code:

if bolShowAdd = true then
adsense(CColor)
bolShowAdd = false
end if


Here is an example:

http://www.thai-wahn.com/topic.asp?TOPIC_ID=4755
Please note: colors only work with rgb values. In case you need a ColorName RGB converter I can post the code here.
Chris evil<
WWW.TIP-THAILAND.DE
The newspaper for the
German speaking Community in South East Asia (Offices in Phuket, Pattaya, Bangkok, Nong Khai, Vietiane)
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Support Moderator
Podge
Posts: 3776
3776
Very nice.

Do you have a separate channel set up for it? If so, how does it compare to adsense on the rest of the forum?<
Posted
Junior Member
Karel Bata
Posts: 122
122

Are you deliberately out to annoy your users with this? It is very intrusive!
<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
Personal feelings aside, its a good mod.
The ad issue is up to each webmaster to decide on his/her own. If user's are ok, then its no big deal. If they're not ok, they'll say so by either saying so or not returning. Either way, bandwidth costs money and I don't know enough to say how to best pay for it. wink<
Posted
Junior Member
Karel Bata
Posts: 122
122

There's a seperate thread debating this here.<
Posted
Junior Member
CarKnee
Posts: 297
297
Originally posted by Podge
Very nice.

Do you have a separate channel set up for it? If so, how does it compare to adsense on the rest of the forum?

I have had an AdSense block running as the first reply in a thread for a while now (year or so). It is displayed ONLY to non registered members and "non-supporting" members.

That channel is the highest performing channel I have. It gets 2x the CTR of the 2nd highest performing AdSense block on the site. However, I have played with colors and images extensively to tweak it.

Going by that "Snitz Stats" thing I have in my signature... if you have a rank close to mine I would suggest implementing it and you may be pleasantly supprised.

I am not getting into a debate about ads being evil or not.<
Posted
Forum Moderator
AnonJr
Posts: 5768
5768
First reply only? and only for non-registered members? And that gets you double your 2nd highest performing block?
Hmm. Though, all things are relative... $2 is double $1, but nothing to do back-flips about. wink Any more concrete numbers to help with the decision? (BTW, I'm not implying that those are your numbers, just that 'double' is a relative thing)<
Posted
Junior Member
CarKnee
Posts: 297
297
Originally posted by AnonJr
First reply only? and only for non-registered members? And that gets you double your 2nd highest performing block?
Hmm. Though, all things are relative... $2 is double $1, but nothing to do back-flips about. wink Any more concrete numbers to help with the decision? (BTW, I'm not implying that those are your numbers, just that 'double' is a relative thing)

I only display the block in the thread to "non-supporting" members (this includes non-registered and non-logged in people). Members of a community web site have "ad blindness" and will most likely not click on any ads.
Furthermore, I tested placing the ad at random positions on the second and greater pages, but their performance was horrible so I removed them.

I didn't say income was doubled, I said Click Through Rate (CTR) was doubled. wink Income isn't directly proporional to CTR. Income would depend on the format/size of the AdSense block, the keywords you are targeting, etc...

For instance, if I have a thread that starts talking about taking a cruise vacation then I get an adsense block pushing a vacation. Those ads will get a different amount of $$ then a block in a thread about viagra.

-CarKnee<
Posted
Starting Member
bpopark
Posts: 8
8
Hey my first MOD for the adsense

http://www.bpopark.com/forum/topic.asp?TOPIC_ID=21

thanks dl4gbe

Just that I had to figure out for long where I had to put these MOD
if you specify between what that wd be great for the beginners

till then take care

Pawan



<
www.bpopark.com/forum
Posted
Senior Member
weeweeslap
Posts: 1077
1077
has anyone had problems with the laying out of this in IE? I am using ie7 beta 3 and I am having width issues in which is spreads the topic wide and in firefox it displays at it should within the borders of the layout of the site. Well not on all topics, topics with more tha one page, example, topic with no additional pages it displays fine:
http://www.weeweeslap.com/forum/topic.asp?TOPIC_ID=12651
topics with more than one page it extends out:
http://www.weeweeslap.com/forum/topic.asp?TOPIC_ID=12631&whichpage=1

But in firefox both are seen as they should be seen so it can be an IE7 issue. My better question is, does anyone have a topic.asp file with this mod installed. I may have added code in the wrong place as adding the code at the end of the big reply loop added the code in a place where it was not expected so I added it elsewhere and it placed it where it should but the proble mentioned above. If anyone has mor einfo this I'd appreciate it. Thanks.<
Posted
Starting Member
jas168
Posts: 2
2
hi can some one give some instrustion where to put the codes... thank you advance<
You Must enter a message