Tuesday, 3 February 2009

How to prevent Adsense from displaying Non-English Ads on an English Language website

Share
Have a weird issue here on blogacause.  Seems Google adsense thinks this is a polish and/or spanish language website, which when it becomes the center of advocacy blogging it well might be a good idea to have ads in many languages to serve the interests of visitors from those respective countries.  However, at this time most of my traffic comes from United States and well, American's just don't click on advertisement they cannot understand in terms of language. 

The reason this is happening is the way the domain name and the Home Page Title tag have the sites name concatenated together into BlogACause.  The word "Bloga" in both polish and spanish means "blog"!  Oy!  It also seems that ads generated within the context of those languages also pays significantly less than ads in english.

After doing a little research I came upon a very helpful and not very well publicized feature of adsense called "section targeting" which allows me to put a special tag around text that I want the adsense context bot to recognize or give more "weight" to instead of other text on the page.   Blogacause uses Coldfusion for the home page with css divs encapsulating cfincludes to control layout, this made implementing "section targeting" very easy as follows:

I want adsense to give more weight to the home page entries list so I tagged them as follows:
note: special adsense tags in red

       <div id="entries">
        <!-- google_ad_section_start -->
        <CFINCLUDE template="includes/entries.cfm">
        <!-- google_ad_section_end -->
       </div>

I further want adsense to give less or no weight to other areas of the home page so I tagged them as follows:
note: special adsense tags in red

        <!-- google_ad_section_start(weight=ignore) -->
        <CFINCLUDE template="includes/header.cfm">
        <!-- google_ad_section_end -->

In this way I was able to pinpoint exactly the text content that I want the Google adsense ads to be based on and hopefully Google will realize that blogacause is primarily an english language site.

Technorati Tags:

Posted by CFAlchemist at 11:25 PM in Web Marketing

Found this cool link to some Industry/Cross-Industry Schema Libraries

Share
Altova Schema Library

Technorati Tags:

Posted by cfalchemist at 10:22 PM in Uncategorized

.PNG images not displaying in browser not caused by mime issue

Share

The old axiom, "ya learn something new everyday..." hit me outta the blue today.  On a development server we have a folder setup to showcase sample development.  Owner calls me and says none of the .png images are showing up, not on the page to which they are sourced or called directly from within the browser.  I spent about 2 hours trying different MIME type settings (image/png and image/x-png), hacking different settings in the registry and finally folder level settings.  All to no avail.

I ended up calling the domain host and putting in for a fix ticket as I thought perhaps it was a re-install of some component that got messed up with some update or install.  Come to find out the solution lie in a totally unsuspected area.

Since this company is a premier coldfusion application developer, almost all of our servers have coldfusion installed.  This being the main dev server, we have coldfusion along with some other server side services running.  In this instance, the problem lay with an entry in the web.xml.  The following piece of code was the culprit.

    <servlet-mapping id="macromedia_mapping_14">
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.png</url-pattern>
    </servlet-mapping>

If a request for the image or the html page (which contained src links to the png image) was made at this point, IIS would hand off the request to the connector to handle the png's, but the connector would have a list of mappings that it got from ColdFusion's web.xml file, and since web.xml does not contain mappings for .html, the result will be that the connector returns an HTTP 503 status code to the web server for each png src image called and the web server sends that to the client browser.

One can add (or delete) internal mappings to a coldfusion installation by editing the cf_root/wwwroot/WEB-INF/web.xml to create new custom mappings that associate the extensions with the CFMServlet.  In the above code we were telling coldfusion to process all files in the IIS webspace, coldfusion or otherwise, with the extension "png".  This apparently confused IIS since it would load the html page but not load the png images as those were being passed off to the coldfusion connector. 

The final solution was to comment out the web.xml entry as follows:

<!--
    <servlet-mapping id="macromedia_mapping_14">
        <servlet-name>CfmServlet</servlet-name>
        <url-pattern>*.png</url-pattern>
    </servlet-mapping>
-->

Thus, IIS will now handle the processing of the .png images called by src tags within the html page.

 

Technorati Tags:

Posted by cfalchemist at 10:06 PM in Coldfusion Server Administration