WebMasterSam

.Net, SEO, Dynamics CRM, AdSense/AdWords, Dating sites, Silverlight, Web hosting and more

About me

I'm an IT consultant working primarily with the .Net Framework as a developper and architect. I also work on my own on my personnal dating websites. I've been developping websites since 2000.

If you like what I do, feel free to support me

PayPal - The safer, easier way to pay online!

Bookmark

Bookmark and Share

Sponsored links

Amazon hot deals

Computer releases

Last comments

Comment RSS

What is Google Suggest and how does it work ?

Google has recently launched a new feature: Google Suggest. This is really useful and maybe a lot of you already noticed this feature.

What does Google Suggest do for you ?

It will suggest search terms as you type, thus helping you find more specific terms before submiting your search request. It shows you most popular search terms matching the caracters you're typing.

It also shows the number of results each term returns. Actualy I don't know why it does not always display the number of results but sometimes it does.

Also, if you're logged in, some suggestions will be taken from you search history.

If your search terms can lead directly to a website, you will see a site suggestion in the box, as well as other terms suggestion.

If among the terms, some matches advertising (AdWords) search terms, you will see ads in a yellow box "Sponsored links".

If you want (or don't want) to use this feature, you can enable/disable it in the search preferences.

Posted: Jul 19 2009, 11:22 by WebMasterSam | Comments (149) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Google
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Google AdSense tracking in Google Analytics

Google has finally launched something that will help a lot to track the performance of your AdSense campaings. If you already own some websites that uses AdSense to monetize, you will love this new feature because it will allow you to see detailed AdSense revenue by website, which was absolutely not possible with the AdSense-only interface.

What is it ?

It is the ability to link your AdSense account with your Analytics account. By doing this, every impression and every click will be tracked in Analytics.

Where do I go to see the detailed stats ?

When you link your two accounts, you will see a new menu item appear in your Analytics account, just like this one :

You will see 3 different menu items under "AdSense" (in fact 4, but the first is only the summary of the 3 others). These are the 3 different statistics you can get for AdSense.

What will I see in "Top AdSense content" ?

You will get detailed stats (total revenue, clicks, impressions, CTR and eCPM) for every page on your website. This is simply AWESOME. With this feature I discovered that in my dating website, the page that is generating the more revenue is the registration page.

Here's what it looks like :

Like any other Analytics graph you can change the view to "table", "pie chart", "performance chart" and the "comparison chart". You can also sort the table columns and change the time period.

What will I see in "Top AdSense referers" ?

You will see detailed stats (total revenue, clicks, impressions, CTR and eCPM) for each referer. A referer is a domain name on which your ad has been shown and clicked. For example, if 2 people clicks on your ad shown on www.example.com and clicks 2 ads each (40c each), the revenue for the referer www.example.com will be 1,60$.

Let's take a look at this :

With this feature you can easily track where your ads are being shown and which website leads you the most valuable members. As you can see in my stats, my most valuable referer is hotmail.

What will I see in "AdSense trends" ?

You will see what you already see in your AdSense account : revenue by day, just like this :

The only difference is that you will get a little bit more because you can choose exaclty what trend you want to see, by using this menu :

How do I activate it ?

Now that I convinced you to use this awesome feature, let's activate it. First, I assume you already have your AdSense account and your Analytics account and everything is up and running on your different websites.

1. Go to "Analytics settings" on your Analytics account and click on "Edit AdSense linking settings".

2. Check every AdSense website you want to track in your Analytics account.

3. Select the primary website. I suggest you take your biggest revenue generating website (the one that has the more traffic) or the website that is the least editable, because for each other website you will have to open the source code to add something.

4. Open the source code of your other websites and put the little JavaScript code block at the beginning of all pages (it may be a good idea to have a master page on your website where you can globally put the code, instead of opening every page).

It is very important that the tracking code (just like the one below) be placed in the "<head>" tag. If you don't do so, the tracking will simply NOT work. Trust me, I already tried !


<script type="text/javascript">   window.google_analytics_uacct = "UA-123456-1";</script>

Conclusion

Google is and will stay for a while the best advertising company on the net. Just try to find another service that provides you the same tracking functionality.

Don't leave <compilation debug=true /> in production

Because you want your web application to run fast and safely, you don't want to leave to "debug=true" switch on. If you do so, the following things will happen :

Compilation will take longer

Because every .Net DLL must be compiled to be machine specific (at runtime), if you leave debug=true it will take longer because the .Net Framework has to compile more stuff for debugging purpose

Your application will run slower

For the same reason, if your DLLs are in debug mode, they have more stuff for debugging purpose so your code will run slower. Also, it will take more memory, which indeed will help your application run slower.

Everything served by WebResource.axd will not be cached

So this can be bandwith consuming because there is many things that are served by WebResource.axd, even if you don't explicitly use this feature.

----------------------------------------------------

So, what to do if you want to be sure you don't accidently leave a debug=true on your production server ? Just add a "<deployment retail=”true”/>" (system.web section) in your machine.config. This will disable the ability to use the debug mode for all applications running on your server.

Posted: Jul 06 2009, 15:03 by WebMasterSam | Comments (101) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

How to take an ASP.NET 2.0 Application Offline

If you own or manage ASP.Net 2.0 websites, you will like this not very-known feature called the App_Offline.htm.

When you want to take offline an application, you only have to create a small App_Offline.htm and place it at the root of your web application. IIS will automatically detect it and return its content everytime a request is made to this web application (whatever the asked file is). Internally what IIS does is to kill the application domain of the web application.

When you're done updating your website, just delete the file and IIS will start a new application domain with your update content.

This feature is cool but sometimes your users may not see the content of the file if their browser (IE) is showing "Friendly HTTP errors". IE shows you friendly HTTP errors when the size of the response is less than 512ko, so add content to your file so every user will see the page correctly instead of the "friendly" page. Personnaly I don't know what is friendly in "The page cannot be displayed" !

Posted: Jul 06 2009, 13:56 by WebMasterSam | Comments (45) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Do you know Silver Arcade (Silverlight gaming portal) ?

If you like online games like java or flash games, you will certainly like Silverlight games. Basically it's the same thing, you will find similar games, but they are all made in Silverlight so if you're a Silverlight developper, this can be fun to play with.

The Silver Arcade

Posted: Jul 04 2009, 09:14 by WebMasterSam | Comments (100) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Misc
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Will Bing beat Google in search engine war ?

Microsoft has recently launched it's new search engine called Bing. Because Google dominates the world of search engines, existing search engines like Yahoo, Altavista and Windows Live search had to do something to stay in the competition. Microsoft did a great job with it's Bing but will it beat Google ? No. I don't think (and I don't want) Microsoft to beat Google in the web world (search engine, messaging, etc...). Google has the vision a lot of people want, which is continuously evoluting. They do things like people want them to be. Microsoft always to do same thing : take ideas of other people and copy them so they always are behind people (it's not 100% true but in general it's a Microsoft reality).

Let's compare Bing and Google...

  Google Bing
Average search time  <1 second  <1 second
Built-in calculator  Yes  Yes
Global look  Great  Great
Built-in currency converter  Yes  Yes
Ads  Yes  Yes
Relevance of image search results  Great  Great
Widgets on homepage  Yes  No
Relevance of search results  Great  Great
"Did you mean" functionnality  Great  Average
Caching feature  Yes  Yes
Definition (define:) functionnality  Yes  No
In title (intitle:) functionnlity  Yes  No
Number of search results  Great  Good
Shopping search  Yes  Yes
"I feel lucky" functionnality  Yes  No
Map search  Yes  Yes
News  Available everywhere  Not available everywhere
Number of built-in search tools  Great  Average
Translator  Yes  Yes
Travel search  Yes  Yes

If you want to see more comparison, you can take a look at this study by the Catalyst group.

As you can see, Bing is not Google, it only wants to be Google !

Posted: Jul 04 2009, 08:16 by WebMasterSam | Comments (94) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: Misc
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Adding another VPS to be always up and running

From the beginning, my websites are hosted on a single server. At the start they were hosted on a shared hosting plan but last year I switched to a Virtual Private Server (VPS) so I can have full control over my server and configuration. I decided to do this because I always want to have full control over what I do and because I had multiple problems with the shared hosting (lost of data multiple times). At HostDepartment they are not very professionnal and there servers are slow, they put too many websites and databases on there server. With the VPS I get full control and great performance for about 25$/month, and that is awesome (VPSLand).

Even if now I have my VPS I'm not 100% secure in terms of data loss; the fact is that my VPS got corrupted 2 times and each times all my websites were down 10 days (translated in a loss in traffic and revenue), so recently I decided to buy another VPS to be able to switch from one to another when I detect a problem. Everything is identical between the 2 VPS. To switch from one to another I simply have to change to DNS entries (done by a couple of clicks) to point to the other VPS.

The only thing different between the 2 VPS is the fact that I only backup the data (DB and some specific files and folders) from the first VPS. The other is not backed up because it is only temporary (the time I take to repair the first VPS).

With this solution I will avoid the 10 day down; I can be up and running within 2 hours. Yeah it costs 50$/month instead of 25$/month but overall it covers the oney I lose when the websites are down.

Solution for "The server committed a protocol violation: Section=ResponseStatusLine"

If you get an error like "The server committed a protocol violation", you may have some of the following problem (which can be solved by one of the provided solution as well).

Unsafe header parsing

Unsafe header parsing is an option you can turn on on your ASP.Net website (in the web.config) to allow the framework to parse responses. But what is an unsafe header ? It is a header in which the keys contains one or more spaces (that is not allowed in the HTTP 1.1 specifications).

The common case is having a space in the "content-length" header key. The server actually returns a "content length" key, which, assuming no spaces are allowed, is considered as an attack vector (HTTP response split attack), thus, triggering a "HTTP protocol violation error" exception.

To allow the parsing of unsafe headers, add the following to your web.config :


<system.net>
   <settings>
      <httpWebRequest useUnsafeHeaderParsing="true" />
   </settings>
</system.net>

You forgot to allow HttpGet and/or HttpPost on your web.config

If you call a WebService, you must accept the HttpGet and/or HttpPost protocols in your web.config (they are disabled by default).

So add the following to your web.config file :


<configuration>
  <system.web>
    <webServices>
      <protocols>
        <add name="HttpGet"/>
        <add name="HttpPost"/>
      </protocols>
    </webServices>
  </system.web>
</configuration>

You're using Skype

If you use Skype, make sure to uncheck the option for using port 80 and 443.

None of the above: find it yourself

If this has not helped, use the following links to help you find the answer :

Configure network tracing : http://msdn2.microsoft.com/en-us/library/ty48b824.aspx

Interpreting a network trace : http://msdn2.microsoft.com/en-us/library/46fcs6sz.aspx

Posted: Jul 03 2009, 15:37 by WebMasterSam | Comments (29) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net | Programming
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

Adding custom error message to ValidationSummary without validators

Validators are a great thing in the ASP.Net world (as well as the .Net WinForms world...), but sometimes they don't suffice. For example, if you want to validate something not related to a control on the page or something very complex you can't achieve even with the custom validators, you may want a particular solution like this one.

First approach : using the CustomValidator

With this approach you simply have to do the following piece of code when you want to add a custom message to your validator :


CustomValidator val = new CustomValidator();

val.IsValid = false;
val.ErrorMessage = "Custom error message to add to the ValidationSummary";

this.Page.Validators.Add(val);

This is a cool, clean and simple way to add custom error messages to the ValidationSummary.

Second approach : creating a validator by implementing IValidator

The .Net framework allows you to create very custom validator by implementing the IValidator interface. So you create the validator and then use the same technique I've just showed you before, just like this :


public class ValidationError : IValidator
{
    private ValidationError(string message)
    {
        this.ErrorMessage = message;
    }

    public void Validate()
    {
        this.IsValid = false;
    }
}

this.Page.Validators.Add(new ValidationError("Your custom error message"));

Personnaly I prefer this one because you are completely custom and you can add messages in a single line of code.

Posted: Jul 03 2009, 15:15 by WebMasterSam | Comments (279) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net | Programming
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

I don't see ASP.Net 3.5 on IIS; only 2.0 is there

When you configure IIS, you have to tell it which version of ASP.Net you will be using for the website (or web application). Because you can run multiple versions of the framework on the same server, you have to select the correct version on a dropdown list, just like this :

When you install the framework 3.5 you can be surprised not to see it on the dropdown list.

Why do I don't see the .Net Framework 3.5 on IIS ?

You don't see the 3.5 because it is not a complete framework, it's only an "update" to the 2.0, so you only see 2.0. You will have the same exact behavior for the 3.0 framework as it is also an update to the 2.0 (prior to the 3.5).

If you take a look in C:/Windows/Microsoft.Net/Framework/3.5 you will not see as much stuff as you normally see on the 2.0 folder. For example, if you want to run aspnet_regiis for the .Net framework 3.5 you will not find the tool because the 3.5 is the 2.0 in fact, so you will have to run the aspnet_regiis tool for the 2.0 framework.

What about the 4.0 framework ?

This is a different relaity for the .Net framework 4.0 because it's a complete new framework, not only an update to the 2.0 so in IIS you will see an option in the list for the version 4.0 of the framework.

Posted: Jul 03 2009, 14:36 by WebMasterSam | Comments (5) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: .Net
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us