harrywatson Posted June 13, 2014 Share Posted June 13, 2014 Anyone know of a nice wee script that will show if your game has been played? Plenty of click counters out there which simply show how many times the link to the game has been clicked. a href I think they call it. But that will just show you've clicked on the 'intention' to play the game, not that youactually played it. I've found a couple of php routines which might work,here is one of them. http://www.developingwebs.net/phpclass/hitcounter.php At the moment I'm thinking about an event listener toward the end of the game?Has Someone Played The Game??? ? Quote Link to comment Share on other sites More sharing options...
ericjbasti Posted June 13, 2014 Share Posted June 13, 2014 You could learn about the Google Analytics API and create custom events. This way not only would you know if people are playing, you could track how far they get and what they do. harrywatson 1 Quote Link to comment Share on other sites More sharing options...
harrywatson Posted June 14, 2014 Author Share Posted June 14, 2014 Hey thanks ericjbasti, I do use the good 'ol analytics. Still seeking a method for 'on the page' feedback. I guess if you can tell a player what their score was you could post on the pagethat the game was played. Umm haven't tried the php script yet. Real life gettingin the way. If I find a good answer I'll post it here. Many Regards Quote Link to comment Share on other sites More sharing options...
harrywatson Posted June 14, 2014 Author Share Posted June 14, 2014 ok so far I've made a php file 'count.php'<?php$count_my_game = ("count.txt");$hits = file($count_my_game);$hits[0]++;$fp = fopen($count_my_game, "w");fputs($fp, "$hits[0]");fclose($fp);echo $hits[0];?>and a text file 'count.txt' with nothing in it.I've uploaded both to the same directoryas my game and I changed 'index.html'to 'index.php'. Then in 'index.php'I used an include...<p style="text-align: center;">Zombie Missions: <?php include("count.php");?>Works beautifully every time the page is loaded and it increments just like it was told to do. All I need now, is to get it to increment when all the zombies have been shot?So I've got to stick the php include INSIDE an event listener within the game ?I'll keep working on it, meanwhile any insights appreciated.. Quote Link to comment Share on other sites More sharing options...
HappyEnd Posted June 14, 2014 Share Posted June 14, 2014 Increment by an action would require you to use a javascript api to call your php script.You have basically two ways to do it: using a XmlHttpRequest pointing to your php script. Or even more easier instancing an Image object to the desired url (no need to use the image).(new Image).src = "count.php";Note : Would be great in this case to generate 1x1 white image. harrywatson 1 Quote Link to comment Share on other sites More sharing options...
harrywatson Posted June 15, 2014 Author Share Posted June 15, 2014 Thanks HappyEnd, I've tried both your solutions and they both work! Marvelous! :D :D :D Quote Link to comment Share on other sites More sharing options...
thephox1982 Posted June 19, 2014 Share Posted June 19, 2014 You could learn about the Google Analytics API and create custom events. This way not only would you know if people are playing, you could track how far they get and what they do. Yeah this is a great route as it's easy to include the basic get going code and the API isn't hard at all to add custom events, etc.That and the amount of information you get is awesome and it's FREE! Personally this will be the way I go. harrywatson 1 Quote Link to comment Share on other sites More sharing options...
tackle Posted June 23, 2014 Share Posted June 23, 2014 Don't forget Flurry Analytics - super easy to implement and it tracks sessions and custom events. harrywatson 1 Quote Link to comment Share on other sites More sharing options...
enriqueto Posted June 24, 2014 Share Posted June 24, 2014 Don't forget Flurry Analytics - super easy to implement and it tracks sessions and custom events.does flurry work on a browser game? Quote Link to comment Share on other sites More sharing options...
hilty Posted June 27, 2014 Share Posted June 27, 2014 Don't forget Flurry Analytics - super easy to implement and it tracks sessions and custom events. does flurry work on a browser game? Hi guys, I'm trying to implement Flurry in my games but it not seem to be working.Please could you help me? I create the application in Flurry and get the API KEY.After I put this two lines of code in the head section of my game index.html: <script src="https://cdn.flurry.com/js/flurry.js"></script><script>FlurryAgent.startSession("MY_API_KEY_HERE");</script>I'm doing it right?I put it in the wrong place?I need to do anything else? Thanks for all,Cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.