in

dashCommerce

An ASP.NET Open Source e-Commerce Application

Google AdWords

Last post 07-31-2008 1:59 PM by nwscrubs1. 10 replies.
Page 1 of 1 (11 items)
Sort Posts: Previous Next
  • 03-23-2008 10:30 PM

    • danroberts
    • Top 50 Contributor
    • Joined on 02-11-2008
    • Kannapolis, NC (Charlotte)
    • Posts 18

    Google AdWords

    I have been studying this for some time and

    my best guess is to pay through the nose for Google AdWords.

    I have tried everything else and nothing seems to work unless you are

    on the payrole for Donald Trump. I would like to see some code for

    Google Categories or Google in general

    I did create a SiteMap and publish it to google under the WebMasterTools section (you need to open an account, free)

    google will hit you like crazy after a while but mostly because of the products being a guild.aspx it will give lots of errors.

     

    Dan

     

    Dan
    www.chezamour.com
    www.digitalrcs.com
  • 03-26-2008 10:14 PM In reply to

    Re: Google AdWords

    Hey Dan,

    I too had a problem with google, I guess if you're reading the web logs you're seeing that google gets sent to the exception page...

    There's 2 things I did to correct this, the first which isn't necessary but I found that google would also index pages that were html commented in the code, which I didn't want.

    in catalog.aspx at approx line 40 you'll have this:

    <!--

     

    <a href="catalog.aspx?cid=<%#Eval("categoryid") %>" class="subcategory"><%#Eval("categoryName") %></a><br/>

    -->

     

    replace this with

    <%-- <!--

     

    <a href="catalog.aspx?cid=<%#Eval("categoryid") %>" class="subcategory"><%#Eval("categoryName") %></a><br/>

    -->--%>

    this changes the type of comment from a html comment (visible to google) to a c# comment which doesn't get rendered and google doesn't see it.

     

    The second and the "fix" to google getting exceptions is caused by the way asp.net handles the request depending on the user agent.

    In visual studio, right click the project, select: add asp.net folder > App_Browsers

    you'll notice a new folder created called.. app_browsers, right click this folder and select add new item, then add a browser file.

    within this browser file add the following:

    <!--

    You can find existing browser definitions at

    <windir>\Microsoft.NET\Framework\<ver>\CONFIG\Browsers

     

    works for lots of shizzle

     

    http://todotnet.com/archive/0001/01/01/7472.aspx?Pending=true

    -->

    <
    browsers>

    <browser id="GenericMozilla5" parentID="Mozilla">

    <identification>

    <userAgent match="Mozilla/5\.(?'minor'\d+).*[C|c]ompatible; ?(?'browser'.+); ?\+?(http://.+)\)" />

    </identification>

    <capabilities>

    <capability name="majorversion" value="5" />

    <capability name="minorversion" value="${minor}" />

    <capability name="browser" value="${browser}" />

    <capability name="Version" value="5.${minor}" />

    <capability name="activexcontrols" value="true" />

    <capability name="backgroundsounds" value="true" />

    <capability name="cookies" value="true" />

    <capability name="css1" value="true" />

    <capability name="css2" value="true" />

    <capability name="ecmascriptversion" value="1.2" />

    <capability name="frames" value="true" />

    <capability name="javaapplets" value="true" />

    <capability name="javascript" value="true" />

    <capability name="jscriptversion" value="5.0" />

    <capability name="supportsCallback" value="true" />

    <capability name="supportsFileUpload" value="true" />

    <capability name="supportsMultilineTextBoxDisplay" value="true" />

    <capability name="supportsMaintainScrollPositionOnPostback" value="true" />

    <capability name="supportsVCard" value="true" />

    <capability name="supportsXmlHttp" value="true" />

    <capability name="tables" value="true" />

    <capability name="vbscript" value="true" />

    <capability name="w3cdomversion" value="1.0" />

    <capability name="xml" value="true" />

    <capability name="tagwriter" value="System.Web.UI.HtmlTextWriter" />

    </capabilities>

    </browser>

    </browsers>

     

    This will then tell .net to render the page using the same engine as a normal browser, which it doesn't do because of the google user agent.

    Keep an eye on your logs and you'll then see google receiving the correct page instead of the exception page :)

    I hope this helps,

    Stu

  • 03-26-2008 10:16 PM In reply to

    Re: Google AdWords

    Dan also, have you tried google products ? that might also give you an extra "free" avenue to your site.

  • 05-29-2008 4:16 AM In reply to

    Re: Google AdWords

     I would say that generally to have a site optomized for search engine rankings, you will need to make many significant changes.  Luckily, these are also pretty easy because each category is represented by just one page, same with products, etc.

     For example, you will want to dynamically create page titles, descriptions and keywords for each page that is unique.  If you don't do this, your pages might get crawled but probably won't rank well.  In addition, you will want to change the javascript menu's to text links.  I will say that my pages did rank ok before I changed the URL's, but I would suggest you use URL rewriting to structure your URL's.  Besides the ugly look of GUID's, one thing I didn't like is that they change each time a record is added.  So if you delete your products and re-load them your old pages will be gone.  If you use a category ID for categories and a sku for products, at least that same product will always have the same URL even if you re-load your products.  The worst thing that can happen is to get a product listed, and then go and change the URL so the old one doesn't work.

    The best thing about dashcommerce and SEO is that it is open source.  So you can change it to work however you want for free.  I have version 2.0, so I don't know what SEO related changes they have built into the 3.0 release.  

    To get your products and categories to rank well on search engines, there are a few things you must have.

       1. Unique Page Titles on each page.
       2. Unique keywords and meta description on each page.
       3. Good text links to those pages with the keywords in them.  You may want to change the productsummarydisplay.ascx to use standard html links instead of image buttons.

       4. URL's with keywords in them.  (optional but useful)  Loading a category by name is built in, so you can at least change it to use the category name in the query string instead of a GUID.  I don't think it really is a negative to have a query string with one value.  Having the keyword in the URL is more important than a static-seeming name with a random GUID in it.

     You can check out our Medical Scrubs site to see how we have implemented URL structure, text links, and dynamic meta tags if you want.  Some things are simple, some take some work.  Over half of our sales come from search engine traffic, and it's free.  So it's worth the effort compared to pumping thousands into search advertising month after month.

     Good luck.

    Filed under:
  • 06-05-2008 11:44 AM In reply to

    Re: Google AdWords

    I'm curious how extensive these changes we're and how long they took you to make.  Do you have any tips for someone with DashCommerce 2.2 looking to do the same thing?

    RedSwimmer Web Designs
  • 06-05-2008 12:48 PM In reply to

    Re: Google AdWords

    Actually, most of the changes were pretty easy.  The URL rewriting was by far the hardest, and made more difficult by my decision to use subdomains for each manufacturer.  The subdomain changes had many impacts I hadn't planned on such as all cookies needing to be renamed so they would persist across all subdomains.

     Anyway, the dynamic meta keywords and description are pretty easy.  You just put a content place holder inside the <head> tags of the master page.  Then on the product.aspx and catalog.aspx pages you fill that content placeholder with the meta tags.  You can use an ASP:Literal control inside of the Content area and then set the values in the page.load event on the code-behind page.  The title can be dynamically set in the code behind as well in the same page.load event.  On static pages, you would put the meta tags inside the same contentplaceholder, but just list the actual values there and there is no need to populate the content in code.  I did some things on the keywords like strings.replace(product.shortdescription, " ",",") so that each word in the short description would become a comma separated keyword.  You can get as creative as you want in using your database information and populating the title and keywords.

     To change the links to be text links in the catalog pages, just modify the productsummarydisplay.ascx user control.  You can just switch it around so instead of a link button it is a standard link.  The EVAL statements are already there pulling the text and the target pages.  Just re-arrange them a little.

     Even the URL rewriting could be done pretty easily if you don't do all the subdomain things I did.  On the category page for examle, you can already query it by using the category name.  So if you were put some code in the global.asax file to capture a http://www.domain.com/category/widgets.aspx and rewrite it to http://www.domain.com/catalog.aspx?n=widgets then voila, you are set.  You just need to modify the menu user controls to link to the new format.  You also have to do some things like removing spaces when building the links.

     I hope this helped.  The page title is the most important, but every improvement you make can help.  Good luck.

     

     

  • 06-05-2008 1:08 PM In reply to

    Re: Google AdWords

    Thank you that was very helpful.  Did the URL rewritting changes you made help you overcome the issue stualpha mentioned above with Google not indexing the catalog and product pages?  I tried his fix but it hasn't been long enough for me to know if it works.

    RedSwimmer Web Designs
  • 06-05-2008 2:03 PM In reply to

    Re: Google AdWords

    I never had the issues mentioned with product pages or catalog pages.  I don't know why you would bother commenting something out that you don't use.  Just delete it.

     Google has always indexed my product pages, so I'm not sure about the issue.  I do think that using standard <a href=""> type tags on your productsummarydisplay.ascx could fix any postback issues.  You can do the same thing with the images so that there are no postbacks needed to navigate to product pages.

     If catalog pages aren't getting indexed it probably has more to do with duplicate content.  Same keywords, similar titles, and particularly if you have multiple pages of products in the same category.  I am going to get rid of paging on my site so instead of two or three "identical" pages, I have one page with a lot more content.

    I didn't have to do anything with the App_Browsers folder, but that may be a good solution also.

  • 07-31-2008 3:08 AM In reply to

    • Brian
    • Top 25 Contributor
    • Joined on 07-30-2008
    • Posts 28

    Re: Google AdWords

    The above post (Nwscrubs1 05-29-2008 9:16) it mentions that loading a category by name (instead of guid) is built in. How can I change the coding in my website to implement this? I am currently learning ASP.NET so as much detail as possible would be much appreciated.

  • 07-31-2008 3:21 AM In reply to

    • Brian
    • Top 25 Contributor
    • Joined on 07-30-2008
    • Posts 28

    Re: Google AdWords - dynamic metatags

            I was able to add individual category page Title, Description and Keyword tags to each catagory page using the following code. The catagory name becomes the page title, short descrition the page description and the long description (I have amended the CMS to use this for keywords) gives the keywords.

             this.Title = category.CategoryName; 

            HtmlMeta hm1 = new HtmlMeta();
            HtmlHead head = (HtmlHead)Page.Header;
            hm1.Name = "Description";
            hm1.Content = category.ShortDescription;
            head.Controls.Add(hm1);
           
            HtmlMeta hm2 = new HtmlMeta();
            hm2.Name = "Keywords";
            hm2.Content = category.LongDescription;
            head.Controls.Add(hm2);

  • 07-31-2008 1:59 PM In reply to

    Re: Google AdWords - dynamic metatags

    If you look at the PageLoad procedure in catalog.aspx.vb, you will see it checks for a few different query string values.  If it finds a "cid" query string value it will load the category page by the integer categoryID.  If it finds a "n" query string value, it will load the category page by category name.  The only caveat is that you can't have spaces in the category name.

     So if you try a URL on your existing site like:

    www.mysite.com/catalog.aspx?n=redshirts

    it will pull up the page with your Red Shirts category.

    This is a little better than a category ID, because at least it has "red shirts" in it, but not having spaces makes it not as clear if you have a multi word category name.  I would at the very least add some code that would remove dashes before pulling up the category. 

    You would put this in the catalog.aspx.vb

    categoryName = Utility.GetParameter("n")
    categoryName = categoryName.tostring().Replace("-","")

    Then you could call www.mysite.com/catalog.aspx?n=red-shirts  which Google would see red and shirts as separate words.

    If you are serious about SEO, however, you really need to do some URL rewriting and come up with a URL scheme that will take a better looking URL and then redirect it to the catalog page, while taking advantage of the use of the ability to load the page by name.  Such as www.mysite.com/category/red-shirts.aspx  and rewrite it to the URL listed above.

     Either way, the second step is to have the URL's that link to your category pages to be generated correctly.  One place you would do this for example is in the Modules/Cataloglist.ascx user control.  It goes through each category and builds your menu.  It calls the function in the utility.vb file GetRewriteURL.  You could either modify that function, or just have it build the URL the way you want it using the category name.

    I hope that helps.  Jason

     

Page 1 of 1 (11 items)