Take our developer survey. We want your feedback so we can learn how to improve Google Analytics, and make it an even better tool for you.

GAIEcommerceFields Class Reference

Overview

This class provides several fields and methods useful as wire format parameters for Enhanced Ecommerce. See the online developer guides for Enhanced Ecommerce for details on how to use the Enhanced Ecommerce features.

Inherits NSObject.

Class Methods

(NSString *) + productFieldForIndex:suffix:
 Generates an enhanced ecommerce product field. More...
 
(NSString *) + impressionListForIndex:
 Genrates an enhanced ecommerce impression list field name with an index. More...
 
(NSString *) + productImpressionForList:index:suffix:
 Generates an enhanced ecommerce product impression field with the impression list, product index and product suffix as parameters. More...
 
(NSString *) + promotionForIndex:suffix:
 Generates an enhanced ecommerce promotion field with an index and suffix. More...
 

Method Documentation

+ (NSString *) productFieldForIndex: (NSUInteger)  index
suffix: (NSString *)  suffix 

Generates an enhanced ecommerce product field.

Note that field names generated by customDimensionForIndex and customMetricForIndex can be used as suffixes.

Parameters
indexthe index of the product
suffixthe product field suffix (such as kGAIProductPrice).
Returns
an NSString representing the product field parameter
+ (NSString *) impressionListForIndex: (NSUInteger)  index

Genrates an enhanced ecommerce impression list field name with an index.

The return value of this method should also be used as input to the productImpressionForList method below.

Parameters
indexthe index of the impression list
Returns
an NSString representing the impression list parameter
+ (NSString *) productImpressionForList: (NSString *)  list
index: (NSUInteger)  index
suffix: (NSString *)  Suffix 

Generates an enhanced ecommerce product impression field with the impression list, product index and product suffix as parameters.

The output of the method impressionListForIndex above should be used as the input list for this method. The output of customDimensionForIndex and customMetricForIndex can be used as suffixes.

Parameters
listthe impression list for this product impression
indexthe index of this product in the impression list
suffixthe product impression suffix for this field
Returns
an NSString representing this product impression field parameter
+ (NSString *) promotionForIndex: (NSUInteger)  index
suffix: (NSString *)  suffix 

Generates an enhanced ecommerce promotion field with an index and suffix.

Parameters
indexthe index of the promotion
suffixthe promotion suffix (such as kGAIPromotionId)
Returns
an NSString representing this promotion field paramter