Blackberry Widget with Google Analytics

This is another weird thing! Actually I’ve tried to use Asynchronous Snippet but soon I realise that it didn’t work properly in the widget since it would only track the pageView for the first time the widget loaded.

So I’ve decided to use the same code that I use in this website, and everything works!

To track a pageView I use this code:

pageTracker._trackPageview(‘<page_name>’);

To track an event I use this:

pageTracker._trackEvent(‘<category>’, ‘action’, ‘label’);

If you still can’t use Google Analytics in your BB Widget is because maybe you forgot to add :

<access subdomains=”true” uri=”http://www.google-analytics.com”/>
<access subdomains=”true” uri=”https://ssl.google-analytics.com”/>

to your widget permissions!