Scott on Writing

Musings on technical writing...

Google AdSense and ASP.NET View State

I recently decided to try out Google AdSense on a few personal sites I run - ScottOnWriting.NET, NBAWebLog.com, MP3Players101.com, skmMenu.com, and DataWebControls.com - mainly as an experiment to see the effectiveness of text advertising and what sort of revenue streams small, focused sites like these are capable of generating.  (I'll be sure to post an analysis after having collected sufficient data.)

The nice thing about Google AdSense is that it's a breeze to setup.  Once you have an AdSense account, you just choose a few options - colors for the text ads, if you want to serve text ads only or both text and image ads, and if you want to assign the ad to a “channel” (useful for tracking performance of ads on certain sites or pages) - and, based on these selections, you're given a snippet of client-side JavaScript code to add to the page(s) where you want to display the ads.  AdSense automatically scans the content of your site to send targetted text ads, and you get some money whenever anyone clicks on one of your ads.  The precise amount of money you receive depends on the ads served.  Essentially, advertisers can bid on showing their ads for certain keywords, so your revenue depends on how much advertisers are willing to pay for your targetted customer's clicks.

In any event, I got Google AdSense up and running on all of the sites and all of them, save one (NBAWebLog.com), displayed targetted ads.  NBAWebLog.com was displaying nothing but public service ads - Save the Rainforest, Become a Big Brother, and things like that.  Reading up at AdSense, I learned that these public service ads are displayed until AdSense can successfully search and categorize the site's content.  After these public service ads persisted for three days, I emailed the AdSense support staff, and asked them what was up.  They came back and said that their spider could not classify my site due to a large amount of non-standard content near the beginning of the page.

I visited NBAWebLog.com, did a quick view source and found... a large amount of non-standard content - several KB of base64 encoded content in the __VIEWSTATE hidden form field.  This view state information didn't need to be persisted - I wasn't handling postbacks at all from the front page - so I turned off view state from the @Page directive and everything worked out.  I emailed back the Google AdSense staff, got my site respidered, and now it's showing the applicable ads.

On a slight tangent, I have an article on ASP.NET view state coming up on the MSDN ASP.NET Dev Center...

posted on Saturday, May 29, 2004 11:43 AM

Feedback

# re: Google AdSense and ASP.NET View State 6/1/2004 4:32 PM Steve

so i wonder if there is anyway that ViewState and AdSense can get along?

must be a way :-/

# re: Google AdSense and ASP.NET View State 6/2/2004 12:54 PM Scott Galloway

Fantastic article, as usual! Oh, and thanks for the link to my post!

# New Viewstate article on MSDN from Scott Mitchell 6/2/2004 12:58 PM Scott Galloway's Personal Blog

# re: Google AdSense and ASP.NET View State 4/15/2005 7:16 AM david

Is this still an issue? I am getting AdSense ads fine on pages with viewstate. I know this entry is almost a year old, so maybe google's adjusted by now?

# re: Google AdSense and ASP.NET View State 4/19/2005 3:48 PM Nick

Scott - a little off topic, but how would you approach placing the Google Adsense Search feature on an ASP.NET page? The HTML Google provides is a form that posts back to Google, and it doesn't play well with ASP.NET...

# re: Google AdSense and ASP.NET View State 5/4/2005 3:12 PM david

Nick, I noticed you got the AdSense search working. How did you manage to get the form to play well with ASP.NET?

# re: Google AdSense and ASP.NET View State 5/4/2005 3:22 PM Nick

Well, it kinda sucks. I put the adsense Seach bit in an iframe. So it works with IE and Firefox, and not much else, AFIK.

Title:  
Name:  
Url:
Protected by Clearscreen.SharpHIPEnter the code you see:
Comments   

My Links

Ads Via DevMavens

Archives

Post Categories

 

I am a Microsoft MVP for ASP.NET.
I am an ASPInsider.
<July 2008>
SMTWTFS
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789

Comment Stats

DayTotal% of Total
Sunday 1896.8%
Monday 39014.0%
Tuesday 46916.8%
Wednesday 51518.5%
Thursday 54419.5%
Friday 50818.2%
Saturday 1706.1%
Total 2785100.0%

Hour1Total% of Total
12:00 AM 682.4%
1:00 AM 712.5%
2:00 AM 632.3%
3:00 AM 752.7%
4:00 AM 572.0%
5:00 AM 1093.9%
6:00 AM 1114.0%
7:00 AM 1615.8%
8:00 AM 1756.3%
9:00 AM 1505.4%
10:00 AM 1736.2%
11:00 AM 1826.5%
12:00 PM 1906.8%
1:00 PM 1766.3%
2:00 PM 1605.7%
3:00 PM 1324.7%
4:00 PM 1124.0%
5:00 PM 983.5%
6:00 PM 913.3%
7:00 PM 993.6%
8:00 PM 853.1%
9:00 PM 802.9%
10:00 PM 833.0%
11:00 PM 843.0%
Total 2785100.0%

Comments by Blog Entry Date/Time

Day Entry MadeAvg.Total
Sunday 5.14144
Monday 5.35353
Tuesday 4.35444
Wednesday 7.58644
Thursday 6.87625
Friday 5.45414
Saturday 5.03161
Total 5.802785

Hour1 Entry MadeAvg.Total
12:00 AM 5.0035
1:00 AM 1.002
5:00 AM 0.000
7:00 AM 7.0035
8:00 AM 5.45109
9:00 AM 6.34279
10:00 AM 6.41250
11:00 AM 4.28184
12:00 PM 6.98342
1:00 PM 2.87112
2:00 PM 5.29222
3:00 PM 8.54299
4:00 PM 3.9190
5:00 PM 5.78156
6:00 PM 4.52113
7:00 PM 9.32177
8:00 PM 9.06154
9:00 PM 5.14113
10:00 PM 6.2381
11:00 PM 4.5732
Total 5.802785

Learn More About Comment Stats
1 - All times GMT -8...


Blog Stats

Favorite Web Sites

My Books

My MSDN Articles