SEO Success! (almost)

I currently work at StoryTellersClub.com. For about a year we’ve been working on a new digital scrapbooking website, DigitalExpressClub.com. We launched the website in September 2009. If you did a Google search for “digital scrapbooking,” we came up anywhere between pages 26 and 30.

I suggested a few SEO techniques. Here’s what I did in the month of December:

1. Better urls. I changed /ProductDetails2.aspx?id=1234&pt=L to: /Digital-Scrapbooking-Treasure-This-Moment-0110/1120/L. I would have preferred using a keyword that describes the scrapbook layout instead of just the title of the scrapbook layout. But that wasn’t implemented…. yet.
2. Dynamic Page titles and meta tags to describe each page correctly.
3. Alt tags on more images.
4. digitalexpressclub.com redirects to www.digitalexpressclub.com.
5. Created and actively used accounts at flickr.com, facebook.com and twitter.com.

And now we’re on Page 10! That’s a 20 page jump in one month!

I think we jumped to page 10 for a couple of reasons. Firstly, we have great content. Secondly, by changing the urls it allowed Google to see that we have lots of great content. Also, hopefully people are starting to link to those specific products and layouts. All the other minor things that I did probably didn’t have much effect. I think the best thing you can do to improve ranking is to have great content.

Now to get to page 1!

Write errors to a log file in C# asp.net

Writing errors to a log file has helped me in situations where failed code is not directly run by the user. For example, Paypal’s servers calls a file to report back regarding the most recent transaction. I won’t know if anything has gone wrong unless I write it to a log file. Here’s the code:

//Don't forget to add these
using System.Globalization;
using System.IO;
 
public static void writeLog(string text)
{
    CultureInfo ci = new CultureInfo("en-us");
    StreamWriter sw = new StreamWriter(HttpContext.Current.Server.MapPath("~") + "\\" + "Log.txt", true, System.Text.Encoding.ASCII);
    sw.Write(DateTime.Now.ToString(ci));
    sw.Write(": ");
    sw.Write(text);
    sw.Write(Environment.NewLine);
    sw.Close();
}

Also make sure to give the “Network Service” write permissions.
1. Remote into the server
2. Right click the Log.txt file
3. Properties
4. Security Tab
5. Edit Button
6. Click Network Service
7. Write checkbox and then click OK.

Asp.net Blog Software: BlogEngine.NET

This is a great piece of blogging software: http://www.dotnetblogengine.net/

The installation is pretty straight forward with the exception of a couple details.

1. After giving app_data write permissions for Network_Service and uploading all the files. I got an error about custom errors. So I turned it off in the web.config so I could see what the real error is.

Change this:

<customErrors mode="RemoteOnly" defaultRedirect="~/error404.aspx">

to this:

<customErrors mode="Off" defaultRedirect="~/error404.aspx">

2. Now it says that I’m missing a folder, “CSharp,” inside the App_Code folder. Add it and now you’ll be able to visit the default.aspx page.

3. I had multiple admin pages on my website, so I had to add some more details to the blog/web.config file.

I updated the authentication forms node from this:

<forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/login.aspx" cookieless="UseCookies"/>

to this:

<forms timeout="129600" name=".AUXBLOGENGINE" protection="All" slidingExpiration="true" loginUrl="~/blog/login.aspx" defaultUrl="~/blog/admin" cookieless="UseCookies"/>

You may also want to set compilation debug to true:

<compilation debug="true">

Change these back once your done getting things setup.

You’ll find some awesome themes here: http://www.blogenginetheme.com/

Encrypt and Decrypt Javascript Tools

I like to use http://javascriptcompressor.com/ to encrypt and pack my javascript.

I then like to use http://matthewfl.com/unPacker.html to decode or unpack javascript.

Add a Google Map to your website (c# asp.net)

0. Get a Google Maps Api Key.

1. Add this to your head:

<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=your-google-maps-api-key-here" type="text/javascript"></script>

And this:

<asp:Literal ID="googleMapJs" runat="server"></asp:Literal>

2. Update your body tag:

<body onload="load()" onunload="GUnload()">

3. Place this div somewhere:

<div id="map" style="width: 500px; height: 500px"></div>

4. Get the Google Geo Coder class from here:
http://googlegeocoder.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=19146 and place Geocode.cs in App_Code/Csharp. Update the googleKey in Geocode.cs.

5. This function calculates the latitute and longitude based on the address you give it and generates the necessary Javascript:

private void googleMap(string addy, string state)
{
    Coordinate coordinate = Geocode.GetCoordinates(addy,state);
    decimal latitude = coordinate.Latitude;
    decimal longitude = coordinate.Longitude;
 
    googleMapJs.Text = "<script type=\"text/javascript\">\n" +
        "//<![CDATA[\n"+
            "function load(){\n" +
                "if (GBrowserIsCompatible()) {\n" +
                    "var map = new GMap2(document.getElementById('map'));\n" +
                    "\n" +
                    "var gardenPoint = new GLatLng(" + latitude + "," + longitude + ");\n" +
                    "map.setCenter(gardenPoint, 15);\n" +
                    "\n" +
                    "//small controls\n" +
                    "map.addControl(new GSmallMapControl());\n" +
                    "map.addControl(new GMapTypeControl());\n" +
                    "\n" +
                    "//Make a marker\n" +
                    "var gardenMarker = new GMarker(gardenPoint);\n" +
                    "map.addOverlay(gardenMarker);\n" +
                    "\n" +             
                "}\n" +
            "}\n" +
        "//]]>\n" +
        "</script>\n\n";
}

And don’t forget to add using GoogleGeocoder; at the top of your .cs file.