Conversion Tracking – iOS
The MoPub SDK offers a conversion tracking API that you can use to properly measure the effectiveness of app install cross-promotions and direct-sold advertisements.
Basic implementation
Conversion tracking can be implemented by adding a single line to your application delegate, in `-application:didFinishLaunchingWithOptions:`.
Import the `MPAdConversionTracker.h` file in your application delegate if using the open source SDK.
[[MPAdConversionTracker sharedConversionTracker]
reportApplicationOpenForApplicationID:@"<ITUNES_APPLICATION_ID>"];
replacing “\<ITUNES_APPLICATION_ID\>” with your own.
Advanced implementation
If your application already reports installs to your own server, you can choose to use our server-side conversion tracking API instead of bundling this logic in your app.
Whenever you want to us to track conversions for you, simply ping the URL: `http://ads.mopub.com/m/open?v=5&udid=ifa:<ID_FOR_ADVERTISING>&id=<APP_STORE_ID>`
An example: To report a conversion for the Slide To Unlock application with raw IDFA `144C0177-9756-4FB2-8A4B-678BF5BE6220`, the API call would look like: `http://ads.mopub.com/m/open?v=5&id=359315994&udid=ifa:144C0177-9756-4FB2-8A4B-678BF5BE6220`
To maintain the accuracy of conversion data on our servers, please limit your conversion calls to one per unique IFA.
Session tracking
The MoPub SDK will automatically record a “session” event whenever your application enters the foreground. If you would like to deactivate this, you can do so by setting the `SESSION_TRACKING_ENABLED` flag to 0 in `MPConstants.h`.