概览
此类用于为 Google Analytics(分析)匹配构建交易/结帐或其他产品互动相关信息。
您可以使用此类来就商家售出的商品、用户查看的商品或已退款的商品报告相关信息。此类应与 GAIDictionaryBuilder 一起使用。
典型用法:
[tracker set:kGAIScreenName value:@"MyScreen"]; GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createScreenView]; GAIEcommerceProductAction *action = [[GAIEcommerceProductAction alloc] init]; [action setAction:kGAIPAPurchase]; [action setTransactionId:@"TT-1234"]; [action setRevenue:@3.14]; [action setCouponCode:@"EXTRA100"]; [builder setProductAction:action]; GAIEcommerceProduct *product = [[GAIEcommerceProduct alloc] init]; [product setId:@""PID-1234""]; [product setName:@"Space Monkeys!"]; [product setPrice:@100]; [product setQuantity:@2]; [builder addProduct:product]; [tracker send:[builder build]];
此类继承 NSObject。
实例方法 | |
(GAIEcommerceProductAction *) | - setAction: |
设置此产品操作的产品操作字段。更多... | |
(GAIEcommerceProductAction *) | - setTransactionId: |
与交易关联的唯一 ID。更多... | |
(GAIEcommerceProductAction *) | - setAffiliation: |
设置交易的关联价值。更多... | |
(GAIEcommerceProductAction *) | - setRevenue: |
设置交易的总收入。更多... | |
(GAIEcommerceProductAction *) | - setTax: |
设置交易的总税金。更多... | |
(GAIEcommerceProductAction *) | - setShipping: |
设置交易的总运费。更多... | |
(GAIEcommerceProductAction *) | - setCouponCode: |
设置此交易中使用的优惠券代码。更多... | |
(GAIEcommerceProductAction *) | - setCheckoutStep: |
设置结帐流程的进度。更多... | |
(GAIEcommerceProductAction *) | - setCheckoutOption: |
设置结帐的关联选项。更多... | |
(GAIEcommerceProductAction *) | - setProductActionList: |
设置 Google Analytics(分析)信标中与产品关联的列表名称。更多... | |
(GAIEcommerceProductAction *) | - setProductListSource: |
设置 Google Analytics(分析)信标中与产品关联的列表来源名称。更多... | |
(NSDictionary *) | - build |
使用代表此产品操作的这一实例中存储的各字段构建一个 NSDictionary。更多... | |
方法说明
- (GAIEcommerceProductAction *) setAction: | (NSString *) | productAction |
设置此产品操作的产品操作字段。
您可以在“product action values”下面的 GAIEcommerceFields.h 中查看所有有效值。
- (GAIEcommerceProductAction *) setTransactionId: | (NSString *) | transactionId |
与交易关联的唯一 ID。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setAffiliation: | (NSString *) | affiliation |
设置交易的关联价值。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setRevenue: | (NSNumber *) | revenue |
设置交易的总收入。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setTax: | (NSNumber *) | tax |
设置交易的总税金。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setShipping: | (NSNumber *) | shipping |
设置交易的总运费。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setCouponCode: | (NSString *) | couponCode |
设置此交易中使用的优惠券代码。
此值用于 kGAIPAPurchase 和 kGAIPARefund 产品操作。
- (GAIEcommerceProductAction *) setCheckoutStep: | (NSNumber *) | checkoutStep |
设置结帐流程的进度。
此值用于 kGAICheckout 和 kGAICheckoutOptions 产品操作。
- (GAIEcommerceProductAction *) setCheckoutOption: | (NSString *) | checkoutOption |
设置结帐的关联选项。
此值用于 kGAICheckout 和 kGAICheckoutOptions 产品操作。
- (GAIEcommerceProductAction *) setProductActionList: | (NSString *) | productActionList |
设置 Google Analytics(分析)信标中与产品关联的列表名称。
此值用于 kGAIPADetail 和 kGAIPAClick 产品操作。
- (GAIEcommerceProductAction *) setProductListSource: | (NSString *) | productListSource |
设置 Google Analytics(分析)信标中与产品关联的列表来源名称。
此值用于 kGAIPADetail 和 kGAIPAClick 产品操作。
- (NSDictionary *) build |
使用代表此产品操作的这一实例中存储的各字段构建一个 NSDictionary。
一般情况下,用户无需调用此方法。