GAI 電子商務產品類別參考資料

總覽

用來為 Google Analytics (分析) 信標建構產品相關資訊的類別。

您可使用這個類別回報商家銷售的產品相關資訊,或是使用者所看見產品的曝光次數。此類別的例項可以同時與產品動作和產品曝光清單建立關聯。
一般用途:

[tracker set:kGAIScreenName value:@"MyScreen"];
GAIDictionaryBuilder *builder = [GAIDictionaryBuilder createScreenView];
GAIEcommerceProduct *product = [[GAIEcommerceProduct alloc] init];
[product setId:@""PID-1234""];
[product setName:@"Space Monkeys!"];
[product setPrice:@100];
[product setQuantity:@2];
[builder addProductImpression:product impressionList:@"listName"];
[tracker send:[builder build]];

沿用 NSObject。

執行個體方法

(GAIEcommerceProduct *)- setId:
 設定用來在 Google Analytics (分析) 報表中識別產品的 ID。更多...
 
(GAIEcommerceProduct *)- setName:
 設定用來在 Google Analytics (分析) 報表中縮排產品的名稱。更多...
 
(GAIEcommerceProduct *)- setBrand:
 在 Google Analytics (分析) 報表中設定與產品相關聯的品牌。更多...
 
(GAIEcommerceProduct *)- setCategory:
 在 Google Analytics (分析) 報表中設定與產品相關聯的類別。更多...
 
(GAIEcommerceProduct *)- setVariant:
 設定產品的子類。更多...
 
(GAIEcommerceProduct *)- setPrice:
 設定產品價格。更多...
 
(GAIEcommerceProduct *)- setQuantity:
 設定產品數量。更多...
 
(GAIEcommerceProduct *)- setCouponCode:
 設定與產品相關聯的優待券代碼。更多...
 
(GAIEcommerceProduct *)- setPosition:
 設定產品在畫面/產品曝光清單等的位置。更多...
 
(GAIEcommerceProduct *)- setCustomDimension:value:
 設定與這項產品相關聯的自訂維度。更多...
 
(GAIEcommerceProduct *)- setCustomMetric:value:
 設定與這項產品相關聯的自訂指標。更多...
 
(NSDictionary *)- buildWithIndex:
 針對此執行個體中適合用於產品動作的欄位建立 NSDictionary。更多...
 
(NSDictionary *)- buildWithListIndex:index:
 針對此執行個體中適合曝光清單的欄位建立 NSDictionary。更多...
 

方法說明文件

- (GAIEcommerceProduct *) setId: (NSString *) productId

設定用來在 Google Analytics (分析) 報表中識別產品的 ID。

- (GAIEcommerceProduct *) setName: (NSString *) productName

設定用來在 Google Analytics (分析) 報表中縮排產品的名稱。

- (GAIEcommerceProduct *) 的 setBrand: (NSString *) productBrand

在 Google Analytics (分析) 報表中設定與產品相關聯的品牌。

- (GAIEcommerceProduct *) setCategory: (NSString *) productCategory

在 Google Analytics (分析) 報表中設定與產品相關聯的類別。

- (GAIEcommerceProduct *) setVariant: (NSString *) productVariant

設定產品的子類。

- (GAIEcommerceProduct *) 的 setPrice: (NSNumber *) productPrice

設定產品價格。

- (GAIEcommerceProduct *) setQuantity: (NSNumber *) productQuantity

設定產品數量。

這個欄位通常不會與產品曝光搭配使用。

- (GAIEcommerceProduct *) setCouponCode: (NSString *) productCouponCode

設定與產品相關聯的優待券代碼。

這個欄位通常不會與產品曝光搭配使用。

- (GAIEcommerceProduct *) setPosition: (NSNumber *) productPosition

設定產品在畫面/產品曝光清單等顯示的位置。

- (GAIEcommerceProduct *) setCustomDimension: (NSUInteger) 索引
值: (NSString *) value

設定與這項產品相關聯的自訂維度。

- (GAIEcommerceProduct *) setCustomMetric: (NSUInteger) 索引
值: (NSNumber *) value

設定與這項產品相關聯的自訂指標。

- (NSDictionary *) buildWithIndex: (NSUInteger) 索引

針對此執行個體中適合用於產品動作的欄位建立 NSDictionary。

索引參數是產品動作清單中這項產品的索引。
一般而言,使用者不需要呼叫此方法。

- (NSDictionary *) buildWithListIndex: (NSUInteger) lIndex
索引: (NSUInteger) 索引

針對此執行個體中適合曝光清單的欄位建立 NSDictionary。

lIndex 參數是產品曝光清單的索引,索引參數則是該產品在該曝光清單中的索引。
一般而言,使用者不需要呼叫此方法。