PhoneGap Plug-in

This plug-in lets you send iOS AppMeasurement calls from your PhoneGap project.

For help creating a PhoneGap project, see PhoneGap Getting Started with iOS.

To download the plug-in, see PhoneGap iOS and Android Plug-ins for Analytics.

Include the Plug-in

  1. Copy ADMS_Measurement_PhoneGap.m and ADMS_Measurement_PhoneGap.h to the Plugins folder in your PhoneGap project.
  2. Copy ADMS_Helper.js to the www/js folder in your PhoneGap project.
  3. In config.xml, add "<plugin name="ADMS_Plugin" value="ADMS_Measurement_PhoneGap" />" as a child under plugins.

Include the AppMeasurement Library

To download the AppMeasurement library, see Get the Library.

  1. Launch the Xcode IDE.
  2. Copy the ADMS_AppLibrary folder from the ADMS_AppLibrary-*.DMG you downloaded to your project folder or another location on your drive.
  3. Drag and Drop the ADMS_Measurement folder on your Xcode project, and confirm the following settings:
    • Select Copy items into destination group's folder (if needed).
    • Select Create groups for any added folders.
    • Select the targets where you want to use AppMeasurement code.
  4. Click Finish.

Lifecycle Metrics Auto Tracking

Tracking the Lifecycle Metrics requires configuration outside of PhoneGap. To enable Lifecycle Auto Tracking, complete the Implementation steps in the Developer Quick Start.

Use the Plug-in

In html files where you want to use tracking, include:
<script type="text/javascript" src="js/ADMS_Helper.js"></script>

That's it, you are now ready to make measurement calls. See PhoneGap Plug-in Methods.


My syntax is correct, why is the code in the plugin not getting reached?

Check your output console for an error that is similar to: ERROR: Plugin 'ADMS_Plugin' not found, or is not a CDVPlugin

if this error occurs, make sure you performed step 3 in Include the Plug-in.