How To Increase Google Adsense Revenue




Many people think about increasing their Google Adsense revenue. They waste a lot of time for it. I have seen many new bloggers & website owners who experiment on it every day to get high CPM rate.
 
Adsense Revenue depends on three main things and these are-
1. Geographical location of your website user
2. Placement of your Adsense Ads
3. Advertisers’ budget


1. Geographical location of your website user
- It is the most important thing of getting high cpc rate from Google Adsense and you can see it on your Google Adsense Account. Google Adsense Shows the location of your users’ click by country . You can see there that if you get clicks on ads from US , Canada or any rich country you get high cpc rate but if you get clicks from Bangladesh, Kenya etc you get very low cpc rate. So the main thing for getting high cpc rate is geographical location of your website users. If your website drives more traffic from US, UK or Canada you will get very high cpc rate. You can see it below the picture.

How To Increase Google Adsense Revenue
To see the geographical location of your users’ click go to performance tab in your Google Adsense Account and then click on “country”. It will show you the full detail of your users’ geographical location.
2. Placement of your Adsense Ads
 - Placing the ads on your website or blog is another important part to get more clicks. Just see the picture given below to understand where you should place your Google Adsense Ads to get more clicks.
Note-  The dark orange shows the strongest performance and the light yellow shows the weakest performance.



3. Advertisers’ budget
- It is the last important thing of getting high cpc rate from Google Adsense because many advertisers bid very low cpc rate So if you want to get high cpc rate you should make your adsense units targetable for Google Adword advertisers. To make targetable your ad units first add a custom channel to your ad units and after than make it targetable. You will see a check box called “targeting” when you add a new custom channel.
I hope if you fix these three main things you will get high cpc rate from Google Adsense.
[Read More...]


Using PayPal’s Instant Payment Notification with PHP



We are going to combine Paypal with PHP to allow for the easy processing of payments on your website.

Step 1 – Creating a PayPal Account

For this tutorial you will need a Premier PayPal Account and an online website. Begin by going to paypal.com and click “signup” at the top of the page.

Step 1

Click Get Started under the Premier Title; you will be redirected to a signup form. Please fill in all necessary information. When your account has been created, login and move on to step 2.

Step 2 – Enable IPN

In this step we are going to enable Instant Payment Notification (IPN), so while logged in, please click Profile and then choose Instant Payment Notification 

Step 2

Now on the next screen you will see that IPN is set to “off”; click “Edit” to change that.


At the start of this tutorial, I mentioned that you would need an online website. Why? Well we are going to ask PayPal to send us data when a payment is complete. PayPal can’t reach local hosted websites unless you have all settings configured correctly. (This involves opening ports on your router). So, I’ll enter the url to my validation script for example http://www.yourdomain.com/PayPal/ipn.php. PayPal will then post a notification to my server, at the URL I’ve specified.

 

Step 3 – Building a Simple HTML Page

Okay, now we need a simple and basic html page where your visitor can buy access to your download area.
I’m not going to explain all the HTML because i think you should know the basics of HTML before you start with PHP.
index.php – A simple HTML page with a stylesheet.

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <title>Nettuts.com | Purchase access to download area</title>  
  5. <link rel="stylesheet" type="text/css" media="All" href="css/style.css" />  
  6. </head>  
  7. <body>  
  8.   
  9.     <div id="wrap">  
  10.         <h3>Purchase Access</h3>  
  11.         <p>Please click the button below to receive login details for the download area. <br />  
  12.            Already have an account? <a href="login.php">Login</a> here.</p>  
  13.            <!-- Paste your PayPal button code here (That you will get in the next step) -->  
  14.     </div>  
  15.   
  16. </body>  
  17. </html>  
 css/style.css – A simple stylesheet for our HTML Page.

  1. body{  
  2.     background#2D2D2D/* Set Website Background Color */  
  3.     font11px 'Verdana'/* Set Website Font Size & Font Type */  
  4. }  
  5.   
  6. #wrap{  
  7.     margin: 0 auto/* Center Our Content */  
  8.     width500px/* Set The Width For Our Content */  
  9.     background#FFF/* Set Content Background Color */  
  10.     padding10px/* Set Padding For Content */  
  11.     border1px solid #000/* Add A Border Around The Content */  

step 3

 

Step 4 – Building a PayPal Button

We need to create a purchase button, so please click Merchant Services, and then chooseWebsite Payments Standard


You may choose three types of buttons, Sell single items, Sell multiple items and, Subscription. Now in this tutorial we are going to create a single item. When someone purchases this single item, in this case access to a download area. Once the payment has been validated, an email will be sent with there details.

Step 4

Let’s enter some information for our purchase button; you may leave the rest as it is.

Step 4 Settings

When you have finished filling in each section, generate the code. Copy this code to your clipboard, and then paste it insideindex.php – where I added the comment in the html page. Please review step 3, if needed.


This should work perfectly. Users can click the button and complete their purchase.

Step 5 – Writing ipn.php

First, create ipn.php so we can start writing. We’ll use a small snippet that I made from a larger snippet that you can get from Paypal’s website.
Please note that there is no reason to learn this code out of your head! Snippets are handy and save time. I will break it down below.

  1. <?php  
  2.   
  3. mysql_connect("localhost""user""password"or die(mysql_error());  
  4. mysql_select_db("PayPal"or die(mysql_error());  
  5.   
  6. // read the post from PayPal system and add 'cmd'  
  7. $req = 'cmd=_notify-validate';  
  8. foreach ($_POST as $key => $value) {  
  9. $value = urlencode(stripslashes($value));  
  10. $req .= "&$key=$value";  
  11. }  
  12. // post back to PayPal system to validate  
  13. $header = "POST /cgi-bin/webscr HTTP/1.0\r\n";  
  14. $header .= "Content-Type: application/x-www-form-urlencoded\r\n";  
  15. $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";  
  16.   
  17. $fp = fsockopen ('ssl://www.paypal.com', 443, $errno$errstr, 30);  
  18.   
  19. if (!$fp) {  
  20. // HTTP ERROR  
  21. else {  
  22. fputs ($fp$header . $req);  
  23. while (!feof($fp)) {  
  24. $res = fgets ($fp, 1024);  
  25. if (strcmp ($res"VERIFIED") == 0) {  
  26.   
  27. // PAYMENT VALIDATED & VERIFIED!  
  28.   
  29. }  
  30.   
  31. else if (strcmp ($res"INVALID") == 0) {  
  32.   
  33. // PAYMENT INVALID & INVESTIGATE MANUALY!  
  34.   
  35. }  
  36. }  
  37. fclose ($fp);  
  38. }  
  39. ?> 

Please fill in the correct credentials for your database so we can insert data in the next step.
PayPal POSTS data to the url we specified. In this example we only need the email address from the buyer, so that we may send him his login information. This code above will read the data PayPal sends and return the info to PayPal. I’ve added two comments where the code should come if its validated. Additionally, I’ve also added a comment that specifies what should be done if it’s not validated.

Step 6 – Creating the Database

Now we are going to focus on what should happen if the payment is verified. First, we need to build a MySQL table where we store the users information. Just a simple one with an id, email and password field.


Next, we must enter our table details; we need an ID with a primary key selection and it should auto increment; next an email and password field.


For those of you don’t have the time to enter all of this information, below is a small MySQL Dump code to recreate the table.
CREATE TABLE `users` (
  `id` int(10) NOT NULL auto_increment,
  `email` varchar(50) NOT NULL,
  `password` varchar(32) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Step 7 – Account Creation

Open ipn.php again. We are going to write the following code below the “// PAYMET VALIDATED” line.
Our first step is to retrieve the email address of the buyer; PayPal sends all of this info over to ipn.php.

  1. // PAYMENT VALIDATED & VERIFIED!  
  2.   
  3. $email = $_POST['payer_email'];  
 We must create one last variable – which is the password that we will generate using php.
  1. // PAYMENT VALIDATED & VERIFIED!  
  2.   
  3. $email = $_POST['payer_email'];  
  4. $password = mt_rand(1000, 9999); 
 As you can see, we used mt_rand to generate a random password – in this case a numeric value between 1000 and 9999. Next, we need to insert this data into our database. To do so, we’ll use the mysql insert query.
  1. // PAYMENT VALIDATED & VERIFIED!  
  2.   
  3. $email = $_POST['payer_email'];  
  4. $password = mt_rand(1000, 9999);  
  5.   
  6. mysql_query("INSERT INTO users (email, password) VALUES('". mysql_escape_string($email) ."', '".md5($password)."' ) "or die(mysql_error()); 

Here we tell our script to insert the email and the password into our database. I’ve added a mysql_escape_string to ensure that mysql injection isn’t possible. I’ve also added the md5 function to our password so that it will be stored as a 32-character hash. Now the account is created; let’s move on to the next step.

Step 8 – Emailing the Login Credentials

We need to write some code that will email the login information to the buyer. To accomplish this, we will use the php mail function.
  1. // PAYMENT VALIDATED & VERIFIED!  
  2.   
  3. $email = $_POST['payer_email'];  
  4. $password = mt_rand(1000, 9999);  
  5.   
  6. mysql_query("INSERT INTO users (email, password) VALUES('". mysql_escape_string($email) ."', '".md5($password)."' ) "or die(mysql_error());  
  7.   
  8. $to      = $email;  
  9. $subject = 'Download Area | Login Credentials';  
  10. $message = ' 
  11.  
  12. Thank you for your purchase 
  13.  
  14. Your account information 
  15. ------------------------- 
  16. Email: '.$email.' 
  17. Password: '.$password.' 
  18. ------------------------- 
  19.  
  20. You can now login at http://yourdomain.com/PayPal/';  
  21. $headers = 'From:noreply@yourdomain.com' . "\r\n";  
  22.   
  23. mail($to$subject$message$headers); 

Let’s break this email function down. We use the variable $email to get the user’s email address and assign it to the $to variable.
The variable $subject is the title/subject that you will see in your email program. After this, we have our message, which will contain a thank you note as well as the account information. The $email and $password variables in the message will change to the correct information once the email has been sent. We also have set a custom header. When the user receives the email, the “from” address will display as “noreply@yourdomain.com”.

Step 9 – Invalid Payment Email

An invalid payment might occur because of fraud, but also because of a problem with PayPal; so we want to make sure that our customer gets what he paid for.
So we are going to send an email to our site administrator, telling him to contact the buyer for more information. Simply copy the email code we used before and then make the changes listed below.
  1. // PAYMENT INVALID & INVESTIGATE MANUALY!  
  2.   
  3. $to      = 'invalid@yourdomain.com';  
  4. $subject = 'Download Area | Invalid Payment';  
  5. $message = ' 
  6.  
  7. Dear Administrator, 
  8.  
  9. A payment has been made but is flagged as INVALID. 
  10. Please verify the payment manualy and contact the buyer. 
  11.  
  12. Buyer Email: '.$email.' 
  13. ';  
  14. $headers = 'From:noreply@yourdomain.com' . "\r\n";  
  15.   
  16. mail($to$subject$message$headers); 

This code is nearly the same as above, only we made some changes to the receiver, subject and message.

Step 10 – User Login

This is our final step, where we build a simple login form for our buyers. Make a new php file, and name it login.php. We’ll use the same HTML page as used for the index.php, only we will make some adjustments to the content of the page, and of course add a bit of styling to our login form.
login.php – This is the page where our buyers can login.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <title>Nettuts.com | Login</title>  
  5. <link rel="stylesheet" type="text/css" media="All" href="css/style.css" />  
  6. </head>  
  7. <body>  
  8.   
  9.     <div id="wrap">  
  10.         <h3>Login</h3>  
  11.         <p>Please enter your login credentials to get access to the download area</p>  
  12.   
  13.         <form method="post" action="" >  
  14.             <fieldset>  
  15.                 <label for="email">Email:</label><input type="text" name="email" value="" />  
  16.                 <label for="password">Password:</label><input type="text" name="password" value="" />  
  17.                 <input type="submit" value="Login" />  
  18.             </fieldset>  
  19.         </form>  
  20.   
  21.     </div>  
  22.   
  23. </body>  
  24. </html> 
Add to style.css
  1. label{  
  2.     displayblock/* Make sure the label is on a single line */  
  3.     margin3px/* Create some distance away from the input fields */  
  4. }  
  5.   
  6. input{  
  7.     padding3px/* Give the text some more space */  
  8.     border1px solid gray/* Add a border around the input fields */  
  9.     margin3px/* Create some distance away from the labels */  


Now that we’ve made our form, we need to check if the login credentials are correct. I made a few changes to login.php so we can get started:
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head>  
  4. <title>Nettuts.com | Login</title>  
  5. <link rel="stylesheet" type="text/css" media="All" href="css/style.css" />  
  6. </head>  
  7. <body>  
  8.   
  9.     <div id="wrap">  
  10.   
  11.         <?php   
  12.   
  13.         mysql_connect("localhost""paypalUser""test123"or die(mysql_error());  
  14.                 mysql_select_db("PayPal"or die(mysql_error());  
  15.   
  16.         if(isset($_POST['email']) && isset($_POST['password'])){  
  17.             // Verify  
  18.         }else{  
  19.         ?>  
  20.   
  21.         <h3>Login</h3>  
  22.         <p>Please enter your login credentials to get access to the download area</p>  
  23.   
  24.         <form method="post" action="" >  
  25.             <fieldset>  
  26.                 <label for="email">Email:</label><input type="text" name="email" value="" />  
  27.                 <label for="password">Password:</label><input type="text" name="password" value="" />  
  28.                 <input type="submit" value="Login" />  
  29.             </fieldset>  
  30.         </form>  
  31.   
  32.         <?php  
  33.         }  
  34.         ?>  
  35.   
  36.     </div>  
  37.   
  38. </body>  
  39. </html> 
 The code above will check if email and password are both posted. If true, we can verify the credentials. If not, we return a error. The next code we are going to write will be placed below “// Verify”. First we need to turn the post variables into local variables.

  1. $email = mysql_escape_string($_POST['email']);  
  2. $password = md5($_POST['password']); 
 I’ve added an escape function to prevent mysql injection and have transformed the posted password into a md5 hash. Because we did this in our database, we must also hash the user’s password to compare the two values correctly. Now it’s time to verify the data.
  1. $email = mysql_escape_string($_POST['email']);  
  2. $password = md5($_POST['password']);  
  3.   
  4. $gUser = mysql_query("SELECT * FROM users WHERE email='".$email."' AND password='".$password."' LIMIT 1"or die(mysql_error());  
  5. $verify = mysql_num_rows($gUser);  
  6.   
  7. if($verify > 0){  
  8.     echo '<h3>Login Complete</h3> 
  9.           <p>Click here to download our program</p>';  
  10. }else{  
  11.     echo '<h3>Login Failed</h3> 
  12.           <p>Sorry your login credentials are incorrect.'
  That’s All!
And that’s the end of this tutorial.
[Read More...]


How to auto-return customers to store after payment in paypal



  • Click on My Business Setup on your PayPal homepage



  • Click on Customize



  • Click on Edit under Auto Return


  • Select On and enter URL



  • Click Save

[Read More...]


How to create a Buy It Now button via PayPal



  • Click on My Business Setup on your PayPal homepage



  • Select Process Orders



  • Click on View and Edit under Manage your buttons and inventory


  • Click Action button next to Sample Buy It Now Button

  • Select Create Similar Button from the menu



  • Choose button type and enter payment options


  • Select inventory options if required



  • Click on Create Button

[Read More...]


How to remove the withdrawal limit from a Paypal account



  • Click View Limits on your PayPal homepage
  • Click on Lift Limits
  • Click to Add and Confirm a bank account
  • Enter account details, then click Continue
  • Click to confirm Social Security number
  • Enter Social Security number and click Submit
  • Click to Link and Confirm credit or debit card

  • Enter card details and click Continue
[Read More...]


How to Add a PayPal Donate Button in WordPress



A lot of new bloggers use “PayPal donations” as one of the ways to pay the upkeep costs of running their blog. Yesterday, on twitter, one of our new followers was having an issue adding a PayPal donate button to their WordPress Sidebar. Therefore, we have decided to cover this topic thoroughly, so other users in the WordPress community can benefit also. In this article, we will show you a step by step guide on how to add a PayPal Donate Button in your WordPress posts, sidebar, or anywhere else with or without a plugin.

 

Live Demo of what this Tutorial will do:

Donate to WPBeginner

Initial Setup

First thing you need to do is have a PayPal account. If you do not, then create one. Next, you need to login to your PayPal account. You can do so by going to (http://www.paypal.com/login). Note: You would need to upgrade to either Premier or Business account in order to receive payments through PayPal buttons.
Once you are logged in, click on the Merchant Services button in the primary horizontal navigation area. Then click on the Donate link under the Create Buttons heading.
Paypal Merchant Services Page
Now let’s create a Donate Button.
PayPal Create a Donate Button
Once you are done filling out, click on Create Button. Then, you will be prompted to 2 sets of codes: Website or Email. We believe that the email option is the least intrusive, so we recommend that you use this option. By going with this option, it will even work on WordPress.com powered sites. When you click on the Email tab, you will see a link. Copy this link:
PayPal Link for the Donate Button
Now, login to your WordPress admin panel. We will show you how you can add it in a post/page, or how you can add it in the sidebar.

How to Add PayPal Donate Button in WordPress Posts or Page

Click on Create a New Post or Page. You can also add this in an existing post. You would need to go to the HTML Editor instead of the visual editor. So please make the switch. Now let’s add an image for the PayPal button. Below are the codes for some of the official ones:

view source print?

view source print?

view sourceprint?

view sourceprint?

view sourceprint?

view sourceprint?
If you don’t like any of these images, then feel free to create your own and add it in the post. Now, you need to make the image a button. This is when you would need the link that you got from PayPal in the Email Tab. Select the image, and make it link to your Donate Link. An example code would look like this:
view sourceprint?
1<a href="Your Email URL that you got from PayPal" target="_blank" rel="nofollow"><img src="The Image URL" alt="" /></a>
That’s it :) Now you should be able to see a PayPal button in your post or page that actually works.

How to Add PayPal Donate Button in a WordPress Sidebar

Let us walk you through, how you can add the PayPal Donate button in your theme’s WordPress Sidebar. You need to make sure that your theme is widget ready. You can find this out by going to Appearance » Widgets. There you will see bunch of registered widget locations toward the right. Drag the Text widget to the appropriate sidebar, and then add the code like this in there:
view sourceprint?
1<a href="Your Email URL that you got from PayPal" target="_blank" rel="nofollow"><img src="The Image URL" alt="" /></a>
PayPal Donate Button in WordPress Widgets
Save the widget, and you are good to go.

PayPal Donate WordPress Plugins

Now, if you like to use the plugins method, there are few plugins that lets you do exactly what we accomplished in this article.
PayPal Donations – Easy and simple setup and insertion of PayPal donate buttons with a shortcode or through a sidebar Widget. Donation purpose can be set for each button.
Donate Plus – Donation form. Recognition wall. Donation total tracker. PayPal integration.
Multi-Currency PayPal Donations – Receive PayPal donations through WordPress in multiple currencies with the lowest possible fees. (Note: this plugin is good only if you have multiple PayPal accounts in numerous countries. Good for larger organizations).

Live Demo of this Tutorial

Donate to WPBeginner
Please consider following through the process to help us out, and see how exactly it works. You don’t have to make a huge donation ;)

Sources

WordPress.com Support
[Read More...]


 

Categories

Return to top of page Copyright © 2010 | Platinum Theme