AppStoreDownloads
From Admob For Developers
Contents |
App Store Downloads
This page will help you get started tracking downloads from AdMob advertising to the App Store! Download tracking enables you to accurately track the results from your iPhone advertising spend and helps you optimize the performance of your campaign. It allows you to track the number of downloads, cost per download, and conversion rate for your iPhone application advertising.
Download tracking requires an AdMob account. Register or login at http://admob.com.
Step 1: Create an iPhone ad
Create an iPhone ad to drive users to your app's info page in the App Store.
1. Click the "Ads" tab, then "Create iPhone Ad". Choose the "App Store" action.
2. In the App Store URL field, provide your App Store URL (you can find this by right-clicking on your App in iTunes). For example, for the Knots app, the App Store URL is:
http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=290888219&mt=8
3. After creating your ad select the appropriate option from step 2.
* NOTE: Please pause all ads until you have selected one of the conversion tracking options listed in step 2.
Step 2: Report App Downloads
Report app downloads to AdMob. Downloads can be reported in three ways:
Option 1: App Integration (Recommended & Preferred)
Would you like to drop a small code snippet in your app that will automatically report downloads to AdMob, with no additional server logic required? Then this option is for you.
1. Click the "Ads" tab, then "iPhone App Download Tracking". Choose the App you'd like to configure for tracking and click "Configure Tracking".
2. Choose the "App Integration" option. To integrate download tracking, do the following:
A. Add this line to your app delegate's applicationDidFinishLaunching: method:
[self performSelectorInBackground:@selector(reportAppOpenToAdMob) withObject:nil];
B. Add these methods to your app delegate, replacing the string <APPLE ITUNES ID> with your app's iTunes id (provided by Apple):
// This method requires adding #import <CommonCrypto/CommonDigest.h> to your source file.
- (NSString *)hashedISU {
NSString *result = nil;
NSString *isu = [UIDevice currentDevice].uniqueIdentifier;
if(isu) {
unsigned char digest[16];
NSData *data = [isu dataUsingEncoding:NSASCIIStringEncoding];
CC_MD5([data bytes], [data length], digest);
result = [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",
digest[0], digest[1],
digest[2], digest[3],
digest[4], digest[5],
digest[6], digest[7],
digest[8], digest[9],
digest[10], digest[11],
digest[12], digest[13],
digest[14], digest[15]];
result = [result uppercaseString];
}
return result;
}
- (void)reportAppOpenToAdMob {
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; // we're in a new thread here, so we need our own autorelease pool
// Have we already reported an app open?
NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES) objectAtIndex:0];
NSString *appOpenPath = [documentsDirectory stringByAppendingPathComponent:@"admob_app_open"];
NSFileManager *fileManager = [NSFileManager defaultManager];
if(![fileManager fileExistsAtPath:appOpenPath]) {
// Not yet reported -- report now
NSString *appOpenEndpoint = [NSString stringWithFormat:@"http://a.admob.com/f0?isu=%@&md5=1&app_id=%@",
[self hashedISU], @"<APPLE ITUNES ID>"];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:appOpenEndpoint]];
NSURLResponse *response;
NSError *error;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];
if((!error) && ([(NSHTTPURLResponse *)response statusCode] == 200) && ([responseData length] > 0)) {
[fileManager createFileAtPath:appOpenPath contents:nil attributes:nil]; // successful report, mark it as such
}
}
[pool release];
}
3. After you have installed the code snippet, you must Wireshark your application launch to ensure that AdMob is being pinged with the correct data and that the pings are formatted properly (http://a.admob.com/f0?isu=<ISU>&md5=1&app_id=<APPLE ITUNES ID>).
** If your application has not yet been accepted to the App Store, you can still integrate download tracking. Follow the steps included below:
1. Register your app as a publisher with AdMob: http://www.admob.com/s/my_sites/create_iphone_site leaving the URL field blank.
2. In the app tracking code snippet, replace the parameter 'app_id' with 'site_id' and copy and paste your newly create Site ID/Publisher ID where the Apple iTunes App ID should be. The Site ID should look similar to: a144fsqf15d87bf.
3. After your app has been accepted into Apple’s app store, please edit the site ID you created in step 1 and add the iTunes app store URL. To get this URL, simply right click on your app and choose ‘Copy iTunes Store URL’.
Option 2: Download API (For Advanced Users Only)
Use this option if you are collecting ISU information and do not want to make code changes to your app.
1. Click the "Ads" tab, then "iPhone App Store Download Tracking". Choose the App you'd like to configure for tracking and click "Configure Tracking".
2. Choose the "Download API" option.
3. Run your campaign for a few minutes until some clicks have been generated
4. Pause the campaign
5. Ping our API with the ISU data you collect. The ISU data should be hashed using MD5 and formatted as uppercase hex.
The pings made to our API endpoint should be in the following format:
http://a.admob.com/f0?isu=<MD5 HASHED ISU>&md5=1&app_id=<APPLE ITUNES ID>
If you choose to use a site ID, please use:
http://a.admob.com/f0?isu=<MD5 HASHED ISU>&md5=1&site_id=<PUBLISHER SITE ID>
6. Approximately 8-12 hours after your last ping to our endpoint, the Download Tracking status should change from “Pending” to “Running”
A. If after 12 hours the status is still “Pending”, please check that you are posting the correct data to AdMob’s endpoint: http://a.admob.com
Required fields are here:
| Parameter | Name | Required? | Description | Example |
| isu | iPhone device identifier | Yes | A unique device identifier from a downloaded app. We ask that you send the ISU after MD5 hashing the ISU (hex form) and converting to uppercase. | isu=4293C838FC58820B10395C6841E673B7 |
| md5 | MD5 flag | No (but recommended) | A flag indicating that the iPhone ISU has been MD5 hashed. This parameter only needs to be included if the iPhone ISU has been hashed (recommended). | md5=1 |
| app_id | Apple app id | Yes | Your iTunes app id | app_id=290888219 |
| site_id | AdMob site id | Only if an iTunes app id is not available | Your AdMob site id. Use in place of the app_id parameter if your app has not yet been accepted to the iTunes store. Get a site id here: http://www.admob.com/s/my_sites/create_iphone_site. IMPORTANT NOTE: After you are approved by the Apple App Store, please go back into your AdMob account, click to the Sites&Apps page, click on the site ID you created, click on the 'Edit Site' link and add your App Store URL in the URL box, and click 'Save'. | site_id=a144fsqf15d87bf |
Option 3: Publish AdMob ads (For Publishers – May Show Limited Data**)
Use this option if you do not want to do any additional server side app integration AND you are already publishing AdMob ads in your app(s).
If you are not yet a publisher and wish to run AdMob ads please check out: http://developer.admob.com/wiki/IPhone#Getting_Started_with_AdMob_iPhone_Ads
1. Please ensure that under the "Sites and Apps" tab you've already registered an iPhone App Site ID with your app store URL, have integrated AdMob's SDK into your application, and are showing live ads within your app. If you need instructions on how to do this, please click here.
2. Click the "Ads" tab, then "iPhone App Store Download Tracking".
3. Choose the App you would like to configure for tracking and click "Configure Tracking".
4. Choose the “AdMob Publisher” option and check the box next to the app you are currently running AdMob ads in.
** Data Limitations: AdMob will be unable to track all conversions if you do not show an ad to each user. For example: If only 10% of your users see an AdMob ad, we will probably only be able to report conversions on 10% of your total clicks/downloads.
Step 3: Monitor your downloads
Optimize your advertising spend by measuring results.
You can find your download statistics along with your ad performance on http://www.admob.com by following these steps:
1. Click on the "Ads" tab, and click "iPhone Download Tracking".
2. Select the app you'd like to track, and specify a date range.
3. Reporting is broken down by app, by ad, or by day, and includes: ad cost, number of downloads, conversion rate, and cost per download.
FAQ
Q: How does iPhone download tracking work?
A: AdMob's iPhone download tracking enables you to see the amount users that downloaded your app as a result of your spend as an AdMob advertiser. Download tracking works as follows:
1. A user clicks on an AdMob App Store ad.
2. A user visits the App Store Info page and downloads the app.
3. The app reports new downloads to AdMob.
4. AdMob calculates the download rate and the cost per download for all apps reporting download information.
Q: What sort of events can I track?
A: AdMob's iPhone Download tracking allows you to track how many times your application was downloaded from Apple's App store as a result of your AdMob ad spend. If you're interested in tracking other events on a mobile website, AdMob Analytics (http://analytics.admob.com) is a valuable resource.
Q: Is download tracking free?
A: Yes.
Q: Do I have to be an AdMob advertiser to use download tracking?
A: Yes. We track downloads by remembering which users clicked on AdMob ads, which requires that you advertise with AdMob.
Q: I'm an AdMob publisher. How do I set up download tracking for my app?
A: You should be all set! We'll automatically track downloads for each user to which you show an AdMob ad. Note, if you only show an ad to one in ten users, we'll only report on 10% of your total downloads, so be sure AdMob ads are requested on as many app opens as possible. If this is not the case, you may want to consider another integration option.
Q: I don't want to make any code changes to my app. How do I set up download tracking?
A: AdMob's Download API enables developers to report back device identifiers (UDIDs). In order to use this option, you must first be collecting device identifiers from new app downloads and be able to report these back to AdMob on a daily basis via the API as specified above.
Q: My app hasn't been accepted to the App Store. Can I still integrate download tracking?
A: Yes! You'll need to do one of the following:
1. Register your app as a publisher with AdMob: http://www.admob.com/s/my_sites/create_iphone_site
2. Replace the parameter 'app_id' with 'site_id', using the id generated by AdMob above. It should be of the form: a144fsqf15d87bf
Q: How frequently can I make API pings to AdMob?
A: Pings can be made daily, however, we recommend that you ping the data to AdMob as often as possible.
Q: How do I know my API request was received?
A: The API response will return a confirmation for valid requests:
[true]
If the request is invalid, no confirmation will be returned.
Q: How long before downloads will appear in my AdMob reporting?
A: Some download information may appear in under 24 hours. Final download data may take up to three days to appear in your reports.
Q: What device identifier should I use?
A: The ISU provided to AdMob via the Download API must match the UIDevice uniqueIdentifier property, as documented here:
It is a persistent unique 40 character string per iPhone device that is also commonly referred to as the UDID.
Q: What do the different states of Conversion Tracking represent (Not Configured, Pending, Running)?
A:
1. Not Configured - This signifies that a conversion tracking option has not been chosen.
2. Pending – This means that the tracking option has been configured and will change states to running once AdMob registers the first conversion. Please note, that if you have an app(s) that is listed as inactive in your account conversion tracking will not function. You must integrate our SDK within your application or add code using Option 1 in order for us to successfully track conversions.
3. Running – This means that conversions are successfully being tracked and reported using the option you selected.
Q: Does AdMob provide any server side setup support?
A: Since this feature is for advanced users, AdMob does not provide help on setting up your server to post data to our API.
Wiresharking your iPhone App
Follow these steps to set up Wireshark to sniff iPhone applications on OS X -
Install (do once):
1. Download Wireshark from http://www.wireshark.org/download.html .
Run (do each time you restart your computer):
1. Give Wireshark access to sniff your network.
1. Open the Terminal application and run the following commands:
1. cd /dev
2. sudo chmod a+r bpf*
3. ls -l bpf*
2. The last one should list a few bpf entries, and critically, in the permissions listing on the left, there should be three "r"s.
2. Share a wireless network
1. Plug in an ethernet cable to your computer.
2. Click on the Airport (wifi) icon at the top right of your operating system, select 'Create Network', and create a network with a distinctive name.
3. Go to System Preferences, open the 'Sharing' preference pane, and highlight (but don't check yet) 'Internet Sharing'.
4. Choose to share your connection from Ethernet.
5. Choose to share your computers using AirPort.
6. Click AirPort Options and type in the name of network you created in step 2.
7. Check the box next to 'Internet Sharing'.
8. Click Start.
9. Connect your iPhone or iPod Touch to the Wifi network you created in step 2.
3. Launch Wireshark. (It may launch slowly the first time.) Click OK if it pops up an error.
4. Configure Wireshark to only look at HTTP traffic from your wireless card by following these steps:
1. Click Capture Options (or go to the menu item Capture -> Options).
2. Choose Interface "en1". (This is likely to be your wireless card. If not, please use trial and error to find the right interface.)
3. Click Capture Filter.
4. Choose HTTP TCP port (80) from the list, click OK.
5. Click Start. Wireshark is now monitoring your traffic!
5. If you want to filter to see only the stuff you want, follow these steps
1. Click Filter.
2. Click +Expression.
3. Add something similar to 'field name:http host' contains value:"admob" or whatever else you'd like to filter out.
After following the steps above, on your iPhone go to Settings -> Wi-Fi -> turn Wi-Fi ON -> find and join the network you created above. Then simply launch your application from the device and watch Wireshark capture all the packets that are sent back and forth. Any traffic sent to AdMob can be seen through the packets captured.
If you have integrated our download tracking code properly, wireshark should show something similar to the following when filtering out for http host admob:
Hypertext Transfer Protocol
GET /f0?isu=489D43B97061E1E732C1D24E26B57E05&md5=1&app_id=123456789 HTTP/1.1\r\n
GET /f0?isu=489D43B97061E1E732C1D24E26B57E05&md5=1&app_id=123456789 HTTP/1.1\r\n
[Message: GET /f0?isu=489D43B97061E1E732C1D24E26B57E05&md5=1&app_id=123456789 HTTP/1.1\r\n]
Request Method: GET
Request URI: /f0?isu=489D43B97061E1E732C1D24E26B57E05&md5=1&app_id=123456789
Request Version: HTTP/1.1
Host: a.admob.com\r\n
