cusquinho
cusquinho

Reputation: 387

MKStoreKit and Google Analytics SDK in iOS

Has anyone figured out how to integrate MKStoreKit with Google Analytics?

The buyFeature callback does not return the transaction ID, which I would need to make the transaction unique in analytics:

[[MKStoreManager sharedManager] buyFeature:kConsumableProVersion 
onComplete:^(NSString *purchasedFeature, NSData *purchasedReceipt, 
NSArray *availableDownloads)...

Here's the example from Google Analytics doc:

- (void)onPurchaseCompleted {
GAITransaction *transaction =
  [GAITransaction transactionWithId:@"0_123456"            // (NSString) Transaction ID,       should be unique.
                    withAffiliation:@"In-App Store";       // (NSString) Affiliation
transaction.taxMicros = (int64_t)(0.17 * 1000000);           // (int64_t) Total tax (in  micros)
transaction.shippingMicros = (int64_t)(0);                   // (int64_t) Total shipping (in micros)
transaction.revenueMicros = (int64_t)(2.16 * 1000000);       // (int64_t) Total revenue (in micros)

[transaction addItemWithSKU:@"L_789"                         // (NSString) Product SKU
                     name:@"Level Pack: Space"             // (NSString) Product name
                 category:@"Game expansions"               // (NSString) Product category
              priceMicros:(int64_t)(1.99 * 1000000)        // (int64_t)  Product price (in  micros)
                 quantity:1];                              // (NSInteger)  Product  quantity

[[GAI sharedInstance].defaultTracker sendTransaction:transaction]; // Send the transaction.

And I also need a way to figure out the "localized" price information...

Any help would be appreciated!

Upvotes: 1

Views: 118

Answers (0)

Related Questions