Pages

Tuesday, October 8, 2013

Google AdSense - Highest Paying Country Per Click

Goggle AdSense is the best-performing Ad Network that I joined. No other network came closer. However, bear in mind that Goggle AdSense operates by keyword bidding & the country visitor coming from. These two important factors, determine how much you can earn through your website.

In this post, I would like to discuss regarding the best paying country in Google AdSense network.

Since the end of March 2011, publishers allow to see the AdSense reports based on countries. I made a compilation of these data & tabulated in the table below to show the best paying country.

These data are for the period of 22nd March to 24th October 2011, which is slightly more than six months. I remove the country that I received less than 3,000 visitors for the same duration to ensure the data are more representable.

Basically, the countries are ranked based on Revenue per Thousand (“RPM”) with the highest RPM at the first position while the lowest RPM at the last position. This data is real data from my websites. Your data may be slightly different, but I think generally it should be similar.

I hope these data will be useful, to increase your AdSense earnings by focusing on highest payingcountries.




Rank Country
1 South Africa
2 New Zealand
3 United States
4 Australia
5 United Kingdom
6 Norway
7 Canada
8 Switzerland
9 Ireland
10 Netherlands
11 France
12 Denmark
13 Luxembourg
14 Germany
15 Kuwait
16 Sweden
17 Finland
18 Belgium
19 Austria
20 Nigeria
21 Singapore
22 Czech Republic
23 Jordan
24 Portugal
25 Saudi Arabia
26 Qatar
27 United Arab Emirates
28 Italy
29 Greece
30 Ghana
31 Lithuania
32 Ukraine
33 Israel
34 Japan
35 Kenya
36 Latvia
37 Hong Kong
38 Spain
39 Serbia and Montenegro
40 Slovakia
41 Bahrain
42 Malaysia
43 Egypt
44 Hungary
45 Mexico
46 Thailand
47 Bulgaria
48 Poland
49 Slovenia
50 Cyprus
51 Taiwan
52 Oman
53 Colombia
54 Venezuela
55 India
56 Brazil
57 Sri Lanka
58 Russia
59 Panama
60 Chile
61 Argentina
62 Algeria
63 Romania
64 South Korea
65 China
66 Philippines
67 Indonesia
68 Turkey
69 Bangladesh
70 Ecuador
71 Morocco
72 Croatia
73 Vietnam
74 Peru
75 Pakistan

Adsense in Earning Method:

Relevant traffic + Relevant content + Relevant ads = Relevant earnings.

Relevant insane traffic + Relevant content + Relevant ads = Insane earnings.

Irrelevant traffic + Partially related content + Irrelevant ads = Low earnings.

Insane irrelevant traffic + Irrelevant content + Irrelevant ads = Low earnings.

Thursday, February 2, 2012

Step by Step Mobile website design for android, iphone

Steps to create a mobile website for your main website:


a) Add detection code in your main website  to redirect to mobile site like   "m.yourwebsite.com" based  on the UserAgent header.

You can get code from http://detectmobilebrowser.com/. (which has .net, php etc examples). If you use their code - then add code to handle case where  "User Agent" is null or is less then 4 characters in length(sent by automated testing tools).
You may alternatively choose to do the detection using Javascript(instead of serverside code)
for performance reasons.



b) Design your HTML templace with header(logo+header links) , content and 
Footer (Copyright, back to top etc)
eg Go to http://m.cnn.com/ or http://m.paypal.com/ and take a look at layout.



c) Add docType so that iphone/android can recognize that this website is optimized for them.
<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.wapforum.org/DTD/xhtml-mobile12.dtd">


d) Add below header to control the scaling.


    <meta name="viewport" content="width=device-width" user-scalable="yes" initial-scale="1.0" /> <!-- iphone,android -->

You can get idea on viewport at:
http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/UsingtheViewport/UsingtheViewport.html


You may note that  viewport is supported by  both android and iphone browser(which are both derived from webkit)
By default iphone(or maybe android) will assume virtual window width of 980 pixels
even though the width may be only 320 pixels - and  then it will scale it down by 3.


You may add below for blackberry:
   <meta name="HandheldFriendly" content="true" /> <!-- blackberry -->



e)          
Add support for web clips (shortcut/bookmark icon)- by having icon of around 60*60 PNG(for android you may have to use apple-touch-icon-precomposed for higher resolution icons, which when used in iphone - wont add rounded border unlike for apple-touch-icon)


         <link rel="apple-touch-icon" href="images/abc.png" /> <!-- shortcut/bookmark icon  for iphone and android -->


f) You may Add below code to explicitly use favicon - for certain mobile browsers.
(as they don't pick it up from default locations - for optimization purpose)


<link rel="icon"  href="favicon.ico"/> <!--some mobile browser explicitly expects this -->



g) The URL bar takes important real estate space . Hence you may remove top URL bar in iphone and android by scrolling by 1.


<script type="text/javascript" language="javascript">
<!--
        window.addEventListener("load", function() { setTimeout(loaded, 100) }, false);
        function loaded() {
                window.scrollTo(0, 1); // pan to the bottom, hides the location bar
        }
//-->
</script>


Other tips:
a) If you Add labels - then add it above text field - so that there are space between controls.
(else user may touch nearby control by mistake)
Also  you may associate the label to the text field.


b) Prefer 1 or 2 columns format(as you have very low width is default portrait mode).


c) Give option to avoid -  text fields which uses type of password. (as its
easier to make mistakes on small cell phones)


d) Use relative width for images,tables
eg 
<img src ="image.gif"  width=90% height=auto> 
This will make the image automatically increase width in landscape mode.


e) You may note that "webkit" has new css elements  like doing transformation , transition etc 
eg -webkit-transform:rotate(10 deg)


f) You also get new events like touchstart, touchmove, touchend,
gesturestart(two finger touch), gestureend, gesturechange.


If you want pinch zoom etc to be disabled then you addEventListener
to your custom function and code like event.preventDefault() to it.


f) You can use window.orientation to detect portrait view, landscape(left), landscape(right)
eg http://www.engageinteractive.co.uk/blog/2008/06/19/tutorial-building-a-website-for-the-iphone/


g) The media attribute resolves to screen instead of handheld for iphone/android . Hence
you may avoid it or you would need to also check device width to detect if it is iphone.
Eg http://www.table2css.com/articles/how-style-same-html-document-differently-different-display-devices 


h) You may add “tel:” or “sms:” tags(though android is smart enough to detect phone number without it)
http://www.catswhocode.com/blog/10-useful-code-snippets-to-develop-iphone-friendly-websites - good one


i) Add debugging using console.log eg  http://articles.sitepoint.com/print/iphone-development-12-tips  -good one
(In iphone – you can enable developer debugging settings to see  it)


j) If you are getting lots of slow connection(global audience) for your websites – then you may consider optimizations like making “css”(or even images) -  internal/inline(instead of external css) etc. (though android/iphone can open 4 connection at same time)


k.) You may add alt tag to image tags - in case the user chose to disable image tags(to save on 
bandwidth or to save on loading time).


Testing:
It is always a good idea to test on  an actual device. (you may use ipod touch instead of iphone.)

If you don’t have actual device – the next best alternative are the emulators/simulators etc.
For quick(but not reliable) testing - I prefer the user agent  switcher plugin in firefox to simulate mobile websites.


There are professional companies like deviceanywhere which can help you to test with all kind of devices.


Books :  If you are just focussing on making your website work with iphone/android then the material on the web(or this article) should be more then sufficient.  However you would need books like  Programming the Mobile Web which is excellent reference(and it goes beyond android, iphone – and covers all kind of mobile devices)
This may be imp. as globally (outside US) - Nokia sells lots of phone on its Symbian OS.
But the above book does not explain well – and I got more concepts from unrelated – “iphone in action”(which is iphone specific sdk/web development - and hence does not go in depth on mobile websites)
Another alternative is Beginning Smartphone Web Development.

Other blogs:
You my go to http://www.jroller.com/zahid for list of my blogs. (eg android tutorial , firefox plugins etc)

Sunday, February 27, 2011

Stripslashes () PHP Function

Definition: The function stripslashes is used to remove backslashes from data. One use for this function, is to display data to which addslashes has been applied. What this means is that stripslashes would change I\'m hungry into I'm hungry.
Also Known As: Strip Slashes, Remove Slashes
Examples:

 <?php
 $greeting = "Hello, I\'m Billy";
 print stripslashes($greeting);
 ?>

This would output the string: Hello, I'm Billy

 <?php
 $said = 'Who said \"Live long and prosper\"?';
 print stripslashes($said);
 ?>

This would output the string: Who said "Live long and prosper"?

Addslashes () PHP Function

 Definition: The addslashes function is used to add in backslashes [\] to data submitted from your forms. This keeps the input MySQL (and other coding languages) friendly. What this means is that addslashes would change I'm hungry into I\'m hungry.

It is phrased as: addslashes($string_data)
Also Known As: Add Slashes
Examples:

 <?php
 $greeting = "Hello, I'm Billy";
 print addslashes($greeting);
 ?>

This would output the string: Hello, I\'m Billy

 <?php
 $said = 'Who said "Live long and prosper"?';
 print addslashes($said);
 ?>

This would output the string: Who said \"Live long and prosper\"?

Make Addslashes More Universal

When writing user submitted data to a MySQL database, it is important to add the appropriate slashes to prevent errors. If magic quotes is running then there is no need to do anything, but if magic quotes is turned off then you need to run addslashes (). What if you want to make a more universal program, that will work for both types of PHP configuration?

One way to do it is to write a function that checks if magic quotes is running and then runs addslashes () based on the results. We check the status of magic quotes using the get_magic_quotes_gpc () function.

 <?php
 function Mod_addslashes ( $string )
 {
 if (get_magic_quotes_gpc()==1)
{
 return ( $string );
 }
 else
 {
 return ( addslashes ( $string ) );
 }
 }
 ?>

In the code above, we first check if magic quotes is turned on. If it is, we just return the data again. If it isn't we run it through addslashes () first. So, each place in our code where we would have normal run addslashes (), we will now run Mod_addslashes () instead.

Magic Quotes in PHP

What is Magic Quotes?: 
When turned on, Magic Quotes automatically performs an addslashes () on all form data submitted. This means that a [\] is placed before every ['], ["], [\], or nul in the data, so That's Great would be converted to That\'s Great automatically. This all happens before your coding even sees that data, so if you're just passing a string to the next page (and not to a database) it will print out with slashes even though you may not want them.

Why is it Good?: 
If Magic Quotes is running, you can be sure that you won't get any SQL errors due to illegal characters slipping by without a backslash. It saves having to run addslashes () on all the form data that's going to your database.

Why is it Bad?: 
You shouldn't learn to rely on Magic Quotes, or you won't learn to program without it. Also, when you let something automated run, your handing over control. It may seem easy now, but in the long run you may regret it. Plus, you may not always want slashes added, because not all forms go to MySQL, some just pass data to email or echo it on another page.

What about stripslashes (): 
Perhaps your asking, if Magic Quotes is running, why don't I just run stripslashes () on the data I don't want it on? You're right, this does work... BUT do you really want to make sure your running this on every script you ever run, and redo everything you already have running?

How do I know if it's on?: 
If when you run addslashes () you're getting three backslashes instead of one, it's probably running. You can check for sure in your phpinfo () or by running get_magic_quotes_gpc().

How do I turn it off?: 
If you have access to your php.ini file you can edit it to set magic_quotes_gpc = Off. You could also try doing it from your .htaccess by adding the line php_flag magic_quotes_gpc Off. Or when in doubt, contact your hosting provider.

Friday, October 8, 2010

10 Tips to be the top on google search result

Having a Web site that gets found in Google isn't hard to do, but it can be difficult to know where to begin. Here are ten tips to get you started.

1. Start out slowly. If possible, begin with a new site that has never been submitted to the search engines or directories. Choose an appropriate domain name, and start out by optimizing just the home page.
2. Learn basic HTML. Many search engine optimization techniques involve editing the behind the scenes HTML code. Your high rankings can depend on knowing which codes are necessary, and which aren't.
3. Choose keywords wisely. The keywords you think might be perfect for your site may not be what people are actually searching for. To find the optimal keywords for your site, use tools such as WordTracker. Choose two or three highly targeted phrases for each page of your site. Never shoot for general keywords such as "travel" or "vacation."
4. Write at least 200 - 250 words of visible text copy based on your chosen keywords. This is a crucial component to high rankings and a successful Web site. The search engines need to "read" keyword rich copy on your pages so they can successfully classify your site. Use each keyword phrase numerous times within your copy for best results.
5. Create a killer Title tag. HTML title tags are critical because they're given a lot of weight with all of the search engines. You must put your keywords into this tag and not waste space with extra words. Do not use the Title tag to display your company name or to say "Home Page." Think of it more as a "Title Keyword Tag" and create it accordingly. Add your company name to the end of this tag, if you must use it.
6. Create Meaty Meta tags. Meta tags can be valuable, but they are not a magic bullet. Create a Meta Description tag that uses your keywords and also describes your site. The information in this tag often appears under your Title in the search engine results pages.
The Meta Keyword tag isn't quite as important as the Meta Description tag. Contrary to popular belief, what you place in the keyword tag will have very little bearing on what keywords your site is actually found under, and it's not given any consideration whatsoever by Google. Use this tag, but do not obsess over.
7. Use extra "goodies" to boost rankings. Things like headlines, image alt tags, header tags <H1><H2>, etc.), links from other pages, keywords in file names, and keywords in hyperlinks can cumulatively boost search engine rankings. Use any or all of these where they make sense for your site.
8. Be careful when submitting to directories such as Yahoo and the Open Directory Project (DMOZ). Having directory listings are a key component to getting your site spidered and listed by Google. Making mistakes in the submission process could cost you dearly as directory listings are difficult to change later in the game. Therefore, it's important to read Yahoo's How to Suggest Your Site and How to add a site to the Open Directory before submitting.
9. Don't expect quick results. Getting high rankings takes time; there's no getting around that fact. Once your site is added to a search engine or directory, its ranking may start out low and then slowly work its way up the ladder. Some search engines measure "click-through popularity," i.e., the more people that click on a particular site, the higher its ranking will go. Be patient and give your site time to mature.
10. Don't constantly "tweak" your site for better results. It's best not to make changes to your optimization for at least three-to-six months after submission. It often takes the engines at least that long to add your optimized pages to their databases. Submit it, and then forget about it for a while!

If you've followed these tips and still can't find your site in the engines, the first place to "tweak" would be your page copy. If you added less than 250 words of visible text on your pages, this is probably your culprit. Also, double check your keyword density, and make sure that you only targeted two or three phrases per page. Eventually, you'll see the fruits of your labor with many top ten rankings in Google and the rest of the search engines!