For the PocketNotes application, I added the new google analytics code to the php index page. I also added a GA Event for when an application download button is clicked. The first script will let me know when a user visits the page. The second script will let me know when a user has downloaded an application from the website.
I followed the instructions to embed google analytics code dynamically using the information at google analytics.
This allows me to change the code in one place and then deploy it on many different php pages by including the following in a php file within the <head> tags:
<?php //new asynchronous GA code to be used for tracking require_once "nimAnalytics.php"; ?>
I used the event tracker guide to setup tracking for when a user downloads an application based on the information at this google site. An example snippet from this web page is listed below:
<p><a class="awesomeButton" href="./../download.php?file=/pocketnotes/PocketNotesSetup.exe" onclick="_gaq.push(['_trackEvent', 'Downloads', 'EXE', 'PocketNotesSetup.exe']);" target="_self">PocketNotes 1.0 (EXE Installer)</a><br /> This package contains everything you need to use NIM PocketNotes. Simply download the EXE file above, run it and follow the steps of the installation program. You need local installation rights. </p>