Segment analytics


Hi guys, i was wondering if any of you have any luck using [][1] analytics in your ionic apps. I have tried following there javascript tutorial [here][2] without any luck. I have managed to send analytics data when trying it out in browser but when have tried it on a mobile it fails. It looks like the application does not recognise the analytics commands like this one.

analytics.track('Bookmarked Article', {
    title: 'Snow Fall',
    subtitle: 'The Avalanche at Tunnel Creek',
    author: 'John Branch'

if anyone has a idea what could be wrong please share

best regards