Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

How to track web-app usage

Options
  • 12-07-2010 2:41pm
    #1
    Registered Users Posts: 21,257 ✭✭✭✭


    I'm writing an iPhone skin for the mobile version of our web-based product and we would like to track the usage.

    The obvious answer is Google Analytics, but our product is an on-premise installation so there won't be a single publicly available URL.

    I thought that adding a hidden iframe to a page on our own server (IIS) that contains some GA code might work, but it's not registering any hits through the app - only direct browser hits. I can see the traffic going through to the page, so it's definitely being accessed by the app. As the GA stats are 24 hours behind, it makes it a bit harder to test.

    I know that GA have some docs on similar stuff, but I'm not sure they apply to this scenario. The stats don't need to be too detailed really - just an idea of the number of people using it would be a start.

    Any thoughts?


Comments

  • Closed Accounts Posts: 1,200 ✭✭✭louie


    Did you try the image trick tracking?
    1x1px
    <img src="somepage.php?blah-blah" width="1" height="1" />
    


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Thanks for the reply.

    Yep, tried that as well. I've tried adding an image and an iframe to the DOM using JavaScript.

    I've changed it to a straightforward HTML tag today, so I'll have to see if that makes a difference tomorrow when the stats are updated.

    The page is definitely being called as my iPhone emulator allows me to inspect all the DOM elements and it turns up there.

    I got my hands on the IIS log file today and all the requests are there, so if worst comes to worst, I'll be able to use them instead.


  • Registered Users Posts: 2,040 ✭✭✭yuloni


    This post has been deleted.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Thanks - giving that a go now :)


  • Closed Accounts Posts: 24 zoudards


    Hey,

    Have you tried modifying your onload event so it fires an AJAX request if the user agent is iPhone ?
    Depending on what you have in the back end, you can easily write a log file or write in a db in realtime.
    I've done both client and server side to do some tracking, server side may suffice.
    server side example, if you use PHP in the back end use the get_browser method to find out if the request comes from an iPhone or not, and if i does, do your logging part.
    client side, use js to detect the browser and if it's iPhone send an AJAX call to the you server and do the logging there - i prefer that one as it doesn't depend on your server and its capacities. And you can do the logging smart enough so it disregard repeat visits and stuff like this.

    downside of this : you need to build a report view if you want it to look good.

    hth

    Zoudards


  • Advertisement
  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Hi zoudards, thanks for that. I already know it's an iPhone as our product redirects different devices to different themes. So unless my code changes today work with GA, I'll look at just doing something on the remote page that we host. In fact, I might not do any coding on the page, and just run some reports against the IIS log files.


  • Closed Accounts Posts: 24 zoudards


    Hey Eoin,

    I'm not sure I got the problem then ... you built a new skin for your webapp specific for iPhone and you want to log GA-type info to get the usage of that particular skin. You don't want to use GA because it's 24h behind.
    is that it ?


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    Sorry, I'm probably not being too clear. The problems are that:

    1) The web-app is run on clients' servers, not one central website. I've seen some somewhat related docs on the GA site, but I think the whole premise is based on there being a constant URL.

    2) I put the GA code in a page on our own site. The iPhone web-app has an iframe that connects to this page, however GA is not recording these hits - even though I can see that the page is being sent to the iPhone no problems.

    My only problem with GA being 24 hours behind is that it's a pain to test my code as I won't know for another day if it worked or not.


  • Registered Users Posts: 21,257 ✭✭✭✭Eoin


    OK, it looks like switching the iphone to a hard-coded tag rather being created by JavaScript has done the trick - I'm getting the hits now. Thanks for all the help.


Advertisement