August 22nd, 2007 Luke
I’ve been building the template for a new project lately, and it will have Adsense built into the sidebar for users who aren’t logged in. However, having the Adsense box aligned to the left side of the sidebar just looked…ugly. I wanted the Adsense box centered within the sidebar.
After googling, I was told to use absolute positioning to align my Adsense box. The only problem is, I couldn’t seem to actually center the box using absolute positioning.
Then I tried floating the box. That didn’t work either; how do you float something and center it?
Then I stumbled upon the ever-so-handy text-align attribute. I put my Adsense code inside a div:
<div id='ads'>
<!-- Adsense Code Here -->
</div>
And then put this inside my CSS:
div#ads {text-align:center}
And…voila! A centered google adsense box, with minimal extra markup.
Posted in adsense, css, design, monetizing | No Comments »
August 21st, 2007 Luke
Each time I finish a project, I sit back and pat myself on the back before moving on to the next project. And every second time or so that I finish a project, I wonder if there’s any money in this. Adsense, in my case, has had an absolutely dismal return: I’ve made about $4.50 since putting it onto my projects(and blog) in April.
But what about Paypal? I recently explained how to implement donation gifts using Paypal, and that’s something that I’m thinking of doing for my next couple of projects.
What about both?
Right now I’m working on another game that’s sort of an experiment; I want to see how many users will sign up and contribute, if that’s all they can do for now. I also want to try and make some money off of the game. One idea is to charge for extra contributables: something like $3 for another of the item, if a user has money to burn and really wants to contribute more. I could, alternatively, just put adsense into the sidebar. But what about both?
I could have Adsense in the sidebar when a user isn’t logged in. If a user is logged in though, they’d be able to support me through donating money. That means that random visitors might notice the adsense, but users who were constantly coming by wouldn’t be pestered by it - they’re usually not the ones who click on Adsense banners anyway.
I’m still designing the template for this new project, but a combination of Adsense/Paypal makes sense to me for the sake of monetizing.
Posted in Project, monetizing | No Comments »
July 20th, 2007 Luke
Have you ever seen that generic Paypal “Make a Donation” button? I see it a lot.
On some websites, they offer you gifts for donating. Kingdom of Loathing, for example, offers a special item to players who donate; this item then becomes immensely valuable to the other players because they either have to spend real-world money to get it, or pay an exorbitant amount of in-game money to get the item from the player who did spend real-world money to get it.
Have you ever wondered how they did it? It’s actually a lot simpler than you’d think. All you need is a Paypal account, and an authentication system for whatever you’re going to be taking donations for.
Creating a donate button
Creating the donate button is actually the simplest step in a series of simple steps. Once you have logged in to your Paypal account, just go to “Merchant Tools”. On that page you should see a box with the heading “Key Features”; click on “Donations”.
This is where you make your donation button. You even have the option of choosing a custom graphic if you have one(or can make one - I can’t). Virtually every piece of information you need to put in to the form is optional. I usually fill in the Donation Name/Service box, and leave the Donation Amount box blank so that users can donate as much or as little as they want to. If you want to force a user to donate a certain amount, you can enter that amount into the Donation Amount box.
Once you’ve filled in the boxes to your satisfaction, move to the buttons at the bottom of the form. Click on “Add More Options” to move on.
Setting up payment result pages
On this page, the first thing you’ll see are two boxes for URL’s. The first is for where a user should be redirected to if a payment is processed successfully, and the second is where they should be redirected if the payment fails. If all you’re interested in is setting up donation gifts, you will only need a successful payment URL. You’ll want to enter the URL to your donation gift script here.
Getting users their donation gift
When a user gets redirected to your successful payment script, they’ll (hopefully) still be logged in. If that’s the case, you can use whatever information you’re using to mark who is logged in to identify them and give them their free gift. Here’s some pseudo-code for your successful donation page:
if(userIsLoggedIn) {
var userID = retrieveUserID();
var itemID = retrieveItemID(donationGift);
giveUserItem(userID,itemID);
## VERY IMPORTANT
redirect('your/homepage/or/something');
} else {
## User is not logged in -- display a message,
## and give them a support address to e-mail
## about their gift.
}
The redirect once the user has gained their gift is important because it prevents users from seeing the URL they were originally redirected to. If they saw the URL they were sent to, it would be an easy job to just log in and copy/paste the URL that got them their gift over and over. Redirecting the user right after our processing has been finished fixes that problem.
And that’s all there is to it. Hopefully this mini-tutorial has helped you figure out how to start building donation gifts into your own websites; I’m pretty sure I’ve included enough information to at least get the ball rolling. If you’re having trouble, leave a comment.
Good Luck!
Posted in Code, monetizing, paypal | No Comments »
March 16th, 2007 Luke
Well, I’m 18 now. And, as such, that means all these neat new rights. No, I don’t mean things like drinking and voting. I mean stuff like having my own bank account, signing up for Google Analytics, and actually being able to put advertising onto my stuff. Ads have mysteriously appeared all over some of my old blogs, and they just mysteriously appeared here, too. Why, you ask? Because I can, and web hosting isn’t free. Also, traffic is mysteriously picking up, and if I can capitalize on that I might be able to afford another pizza. Maybe one day I’ll make enough off of these to quit my job and just write code or something. I can dream. And tweak them.
Posted in monetizing, site, tweak | No Comments »