To add a Cordova plugin to your app, add the plugin in the PhoneGap > Plugins box. For example:
<plugin name="cordova-plugin-google-analytics" spec="1.8.3" source="npm"/>
<plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.1" source="git"/>
Then you can use the plugin’s functions (in this example the cordova-plugin-google-analytics plugin’s object is available as window.ga) in your theme’s functions.js file :
//In functions.js or in a JS module included in functions.js: window.ga.trackEvent( category, action, label, value );
Then save, export and build the app.