Create HTML5 Vertical Endless Runner cross platform games

Using Phaser framework and other FREE software
Endless runner games are gaining more and more popularity and they are really easy to code.
I will take you by hand through the creation of a complete HTML5 vertical endless runner cross platform game with a lot of features and room for customization.
100 pages + 31 source code examples with a free update to come in a few days.

Playing with Google Analytics API

Emanuele Feronato Php

I think you all know Google Analytics.

A Google Analytics API has long been one of the most widely anticipated (and wanted from developers) features. On April 21st, 2009 the official blog announced that the Google Analytics Data Export API beta is now publicly available to all Analytics users.

The API will allow developers to extend Google Analytics in new and creative ways and integrate Google Analytics into their existing products and create standalone applications that they sell.

Read more at the official post.

So I think it’s time to play a bit with this new toy.

Today we’ll learn how to autenticate to the service.

I made the script you are about to see reading the information at this page.

Line 3: Setting the header to text/plain because I am going to output plain text instead of html

Lines 5-6: Assigning to two variables my Analytics email and password. Obviously replace the xxx with your correct Analytics email and password

Line 8: Initializing a cURL handle. I am using it to communicate to Google servers using HTTP protocol and pass variables in POST mode. More information about the cURL library at this link.

Lines 9-12: Setting some options for the cURL handle. CURLOPT_URL is the URL to fetch, CURLOPT_POST to perform a HTTP POST, CURLOPT_HEADER to include the header in the output and CURLOPT_POSTFIELDS contains the full data to post in a HTTP “POST” operation.

This way I am simulating an HTML form submission to using POST method.

Let’s take a look at the variables I am sending:

accountType: Type of account to be authenticated. The default is GOOGLE (I found it’s not case sentitive).

Email: The user’s email address.

Passwd: The user’s password.

service: The Analytics service name is analytics.

source: A string identifying your client application in the form companyName-applicationName-versionID (actually you can write whatever you want).

Lines 13 and 14 perform and close the cURL session.

This is the result if everything went fine:

The Auth code is what we need to retrieve account and report data. I’ll show you how to do it next time.

At the moment I am integrating the Analytics in a control panel we provide to some customers, in order to give them access to all information from a single page.

Do you have a creative use of this API in your mind? Look at some examples at this link and you will agree this is a great feature

Stay up to date
Follow me on the social networks and never miss a post.

Official Emanuele Feronato Facebook page

Official Emanuele Feronato Twitter account

From null to full HTML5 cross platform game

I will take you by hand from the bare bones of JavaScript programming through the creation of a full cross platform HTML5 game, with detailed explainations and source code.

If you don't know where to start, then From null to full HTML5 cross platform game is the book for you.

Comments 5

  1. Post
    Emanuele Feronato

    at least two reasons:

    1) piwik writes on your mysql db and uses your php resources, analytics does not

    2) most customers already use analytics on their own so saying your software is 100% analytics compatible isn’t the same thing as saying is piwik comatible

  2. Scot

    Thank you for the tutorial. I am looking to find out what to do next – I have the auth code and want to make another request. I personally feel that Google’s API sucks.

  3. Pingback: NEXTブレイクはGoogle Analytics APIで決まり! | カグア!Google Analytics 活用塾:事例や使い方

  4. Pingback: 2009?4?29??????? ?? ???? | ????Google Analytics ???:??????

Leave a Reply

Your email address will not be published. Required fields are marked *