How do I test Apple's new Search Ads Attribution API?

Here is the code I'm using. How can I test `attributionDetails` from Apple so I can ensure my Search Ads Attribution API code is working properly? Apple provides little to no details (https://searchads.apple.com/help/measure-results/#attribution-api) on how developers can do some test dummy conversions for testing.



   + (void)conversionTracking
    {
        if ([[ADClient sharedClient] respondsToSelector:@selector(requestAttributionDetailsWithBlock:)])
        {
            // iOS 10 call exists
           
            [[ADClient sharedClient] requestAttributionDetailsWithBlock:^(NSDictionary *attributionDetails, NSError *error) {
                if (error) {
                    NSLog(@"Request Search Ads attributes failed with error: %@", error.description);
                   
                    if (error.code == ADClientErrorLimitAdTracking) {
                        NSLog(@"Limit Ad Tracking is enabled for this device.");
                    }
                }
                else {
                    NSLog(@"Search Ads attributes: %@", attributionDetails);
                   
                    // Found details, track the purchase.
                    NSString *searchAdsCampaign = @"";
                    // Check value for "iad-attribution":
                    if ([attributionDetails valueForKey:@"iad-attribution"] != nil) {
                        // Check value:
                        if ([[attributionDetails valueForKey:@"iad-attribution"] boolValue]) {
                            // Get campaign name:
                            if ([attributionDetails valueForKey:@"iad-campaign-name"] != nil) {
                                NSString *campaignName = [attributionDetails valueForKey:@"iad-campaign-name"];
                                // Exclude Apple test data, where value is "CampaignName":
                                if ([campaignName isEqualToString:@"CampaignName"]) {
                                    searchAdsCampaign = @"No Campaign";
                                }
                                else {
                                    searchAdsCampaign = campaignName;
                                }
                            }
                            else {
                                // Key not found:
                                searchAdsCampaign = @"Error";
                            }
                        }
                        else {
                            // Value "false":
                            searchAdsCampaign = @"No Campaign";
                        }
                    }
                    else {
                        // Key not found:
                        searchAdsCampaign = @"Error";
                    }
                   
                   // TRACK IT HERE. Pass up searchAdsCampaign for tracking to my server.
                }
            }];
        }
    }

The requestAttributionDetailsWithBlock will return sample dummy data when you make the call to Apples Servers from an iOS Simulator (maybe also from an actual test device in debug mode).


See my blog post here https://kitefaster.com/2016/12/02/how-to-use-the-attribution-api-for-tracking-installs-via-apple-search-ads/ for how I implemented it and the sample data returned. Note that there is a minor descripency between the sample data fields returned and the real world fields returned.

How do I test Apple's new Search Ads Attribution API?
 
 
Q