Code execute once on start


My questions is if there is a way in Ionic 2 to execute code only once for example the google analytics init'YOUR_TRACKER_ID')
   .then(() => {
     console.log('Google analytics is ready now');'test');
     // Tracker is ready
     // You can now track pages or set additional information such as AppVersion or UserId
   .catch(e => console.log('Error starting GoogleAnalytics', e));

Where should i put it?. Thanks


I would put it in the constructor of the app component.