A way to use AIR for Android (for Android / iPad / iPhone) in combination with Google Analytics to track pages/application screens without using Javascript but by directly calling Googles tracking pixel. Included is a PHP file and an AS3 Class to make the calls.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
php
src/nl/funkymonkey/android/tracking
README

README

A way to use AIR for Android (for Android / iPad / iPhone) in combination with Google Analytics to track pages/application screens without using Javascript but by directly calling Googles tracking pixel. Included is a PHP file and an AS3 Class to make the calls.

Copy both files located in the PHP directory on the root of your own server. And follow the instructions below. 

In tracking.php edit the following lines 

$var_utmac='UA-000000-00'; //enter the new urchin code
$var_utmhn='yourdomain.com'; //enter your domain

and adjust them in such a way that it uses your tracking code and your domain name.

If you are using a newly created tracking code from within GA, make sure you test/activate it first. You can do this by pasting your tracking ID in the tracking_test.html. Look for this line

_gaq.push(['_setAccount', 'UA-000000-00']);

Where the UA begins is your tracking ID. Paste your code here.

When implementing the AS3, use the instructions below:

Usage:
// Setup tracking
UrchinTracker.setApplicationName(DocumentClass.APPLICATION_NAME);
UrchinTracker.setDomain("http://yourdomain.ext");

// Do actual tracking
UrchinTracker.trackDevicePage(AnalyticsPageNames.SPLASH_PAGE);

Make sure the actual strings in AnalyticsPageNames do not contain any spaces and at the end have a slash. 
This is correct: "test_page/"
This is incorrect: "test page"
This is incorrect: "test page/"

Any questions comments or remarks, email me!

Author:
Sidney de Koning
sidney@funky-monkey.nl