有没有人想出如何将 MKStoreKit 与 Google Analytics 集成?
buyFeature 回调不返回交易 ID,我需要使交易在分析中唯一:
[[MKStoreManager sharedManager] buyFeature:kConsumableProVersion
onComplete:^(NSString *purchasedFeature, NSData *purchasedReceipt,
NSArray *availableDownloads)...
这是来自 Google Analytics 文档的示例:
- (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.
而且我还需要一种方法来找出“本地化”的价格信息......
任何帮助,将不胜感激!