Sunday, 4 September 2011

How to Make Money From an HTML5 Game (Adsense, Merchandise, etc.)

Making a game is only half the battle if you are looking to make money from your creations. Once you've made the game, you will want to think of ways to make money from it.
A lot of what I'm going to go into in this post applies to any kind of game, although I'm using HTML5 games as the focused example.

One way would be having a donate button, but personally I like to stay away from donate buttons, because it feels a bit like begging. I rather make money through giving a service to people.
There are three main services you can provide; merchandise, advertising and in-game purchases.

Merchandise: I haven't really focused on selling merchandise much, I've only set up a small test store at CafePress, however I may focus more on that in the future.
Setting up a CafePress store is pretty simple, you just sign up, and pick an item, and add your artwork to it. (Note that it needs to be your own artwork, copyrighted materials is a huge no-no)

Advertising: There are many ways to go about this. The most popular way to advertise on a web page is to use Google Adsense. You just set up an account, get your site approved, then add a little block of code which generates adverts from the sites that people using adwords have created. Adwords is where people put up their sites looking for traffic, Adsense is where people put those ads on their website to give them traffic and get money in return (which the Adwords people are paying).
There are many other services similar to Adsense, but none are close to being as profitable. The only case that I would suggest you use a service other than Adsense is if you have pornographic material, or something else which goes against Google's terms.
There is one other way, which takes a lot more effort, although has potential to make more money. Making deals with people individually. This means you directly talk to someone to make a deal that you give them traffic for whatever price. The deal would specify how the traffic is given (text link/banner image/whatever).

Where to put the ads? You could put the ads around the page that the HTML5, Flash or Java game is on (this requires the game to not be full screen). The page this article is written on has Adsense ads around the place, that is an example of where ads can go, and same applies to pages HTML5 games etc are on too.
Another place they can go is in a pause menu of a HTML5 game. This works for full-screen games and non-full-screen games. What you'd do for that is, put the ad's code inside a <div id="whatever" style="display: none;"></div>. This will load the ad, but it will be invisible. In the game's code, you just have to make it that when the game is paused, it makes it appear.
Example:
document.getElementById('whatever').style.display="";
Then when the game is unpaused, use:
document.getElementById('whatever').style.display="none";
Here is an example of adsense in a pause menu of a canvas game


How much money do the ads make? This is a pretty big question. It is dependent on so many different things. It would depend on what ads actually show up, which depends on both your target audience, and the topic of the game. It also depends on how much traffic you get to your site. You need hundreds to thousands of visits per day to make any amount of money. And a huge problem is that people don't trust ads any more. The ad services that aren't Adsense have put up so many scammy ads that it gave the reputation of internet ads so much shit. However, Adsense ads are very trustworthy and they very often provide quality and interesting links.


In-game Purchases: Depending on what kind of game it is, you could have things like purchasable clothes for your character, or vehicles, etc.
Firstly, you'll need to set up a database to hold usernames, encrypted passwords and what purchases have been made by whom. When you have the database set up, you will be able to have a php script that deals with it, and you can then use AJAX in your HTML5 game's JavaScript which runs the script, putting in parameters like "username" and "itemtobuy".
From there it will be able to access something like PayPal to accept a payment. Then, in your game you will be able to have it check for what purchases have been made, and it can decide what things to show up.
You could also use a service specifically for In-App purchases. Such as Google In-App purchases.


It is a lot harder to make money than people think. And the best way to make sure you do make money, is to make sure your game will appeal to people. A lot of people have the wrong idea of what kind of games will appeal to people. Too many people think it just needs to be "cool", but it actually doesn't.
It needs to be addictive. And to do that, it either needs to be simple enough to just lazily do without too much thought, or complex enough that it fucks you in the mind and you just need to keep trying until you get it right.
There's a whole lot more to it than that, but I'm just giving you some food for thought.