- Home /
How to monetize my facebook canvas game?
Hey guys, as the title says, I am looking for a good tutorial on how to implement ads in my unity webplayer game on facebook. I've seen lots of stuff for mobile apps but none for canvas. I'd like to use ad4games as the adprovider because its facebook aprooved and I saw many other facebook games using it. The main problem is, that I am using the Facebook SDK and have no option to edit the html file because only the unit3d.build will be loaded by facebook. Does anyone have any experience with this?
Looking for answers too, I think it will require http://docs.unity3d.com/ScriptReference/Application.ExternalEval.html
Hi,
We signed up with Lifestreet which has an ad implementation using Application.ExternalEval specifically for Unity3d. We are able to created new div's and place ads above, below or to the sides of our app. We are having an issue though, when even one of their ads is in it hurts our framerate. They are running some Flash code but we find it strange that it would have any effect since they are just simple animated ads. Let me know if find another solutions. We are looking to alternatives in case we can't sort out our framerate issue.
Answer by Kiwasi · Oct 08, 2014 at 04:08 AM
I've been looking for this for a while. Using the Facebook-Unity integration it is difficult if not impossible. Most ad severs require HTML with the script tag to be on the webpage. For security reasons modern browsers will not run scripts that are injected in. So Application.ExternalEval is a dead end.
You best bet is to forgo the Facebook-Unity integration and build your own HTML with the ads and the webplayer embedded. Then direct your Facebook app to the HTML code.
I'm personally just about fed up with trying to get Facebook to play nice. There whole set up is not very developer friendly. For instance there will be Facebook ads placed next to your game, but you don't get a cent of their revenue. They also don't allow you to use google ads, which is pretty much industry standard. Then there are the various rounds of permission to get anything posted on Facebook. The SDK is poorly documented. It won't run unless you are on canvas (effectively locking your game in). The data from the open graph is relatively difficult to interpret.
For the moment I'm looking into game portals as a better option. I can always go back to Facebook if the game has any level of success.
Good to know. I'm still a bit earlier along in the process and was trying to decide if I wanted to use ads or in-app purchases (or both). I think this is one more reason to try to design without ads, for this game anyway.
Answer by Mitralone · Oct 16, 2014 at 02:21 AM
Hi there,
I just managed to inject an ad from appnext below unity game in facebook canvas. I am using unity integration. It is working. Just first test the javascript in a simple web page and once you are sure the javascript is able to inject the ad into the web page then do it in unity with Application.ExternalEval.
Now I need to find a way to get reward ads in unity :)
Appreciate your effort. I hope you successfully got reward ad, please help me out with appnext code, i don't know why it dont show me ad in browser. Sample Please look at code the Sample page link or give me URL of sample page you made to test. Thanks in advance