summaryrefslogtreecommitdiff
path: root/StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2017-09-21 15:50:05 +0200
committerJules Laplace <julescarbon@gmail.com>2017-09-21 15:50:05 +0200
commitcc8e24461c625400143677956bdffb9268d8050b (patch)
tree71cdae83f6b1e15ab99471fe3b1995fb907d5154 /StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h
parentc1bd61b6ad4b3d4d1cd2da81f6ec403565cc1f4b (diff)
analytics plugin
Diffstat (limited to 'StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h')
-rw-r--r--StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h b/StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h
new file mode 100644
index 00000000..029f7638
--- /dev/null
+++ b/StoneIsland/plugins/cordova-plugin-google-analytics/ios/GAIEcommerceProduct.h
@@ -0,0 +1,102 @@
+/*!
+ @header GAIEcommerceProduct.h
+ @abstract Google Analytics iOS SDK Hit Format Header
+ @copyright Copyright 2014 Google Inc. All rights reserved.
+ */
+
+#import <Foundation/Foundation.h>
+
+/*!
+ * Class to construct product related information for a Google Analytics beacon. Use this class to
+ * report information about products sold by merchants or impressions of products seen by users.
+ * Instances of this class can be associated with both Product Actions and Product
+ * Impression Lists.
+ * <br>
+ * Typical usage:
+ * <code>
+ * [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]];
+ * </code>
+ */
+@interface GAIEcommerceProduct : NSObject
+
+/*!
+ Sets the id that is used to identify a product in GA reports.
+ */
+- (GAIEcommerceProduct *)setId:(NSString *)productId;
+
+/*!
+ Sets the name that is used to indentify the product in GA reports.
+ */
+- (GAIEcommerceProduct *)setName:(NSString *)productName;
+
+/*!
+ Sets the brand associated with the product in GA reports.
+ */
+- (GAIEcommerceProduct *)setBrand:(NSString *)productBrand;
+
+/*!
+ Sets the category associated with the product in GA reports.
+ */
+- (GAIEcommerceProduct *)setCategory:(NSString *)productCategory;
+
+/*!
+ Sets the variant of the product.
+ */
+- (GAIEcommerceProduct *)setVariant:(NSString *)productVariant;
+
+/*!
+ Sets the price of the product.
+ */
+- (GAIEcommerceProduct *)setPrice:(NSNumber *)productPrice;
+
+/*!
+ Sets the quantity of the product. This field is usually not used with product impressions.
+ */
+- (GAIEcommerceProduct *)setQuantity:(NSNumber *)productQuantity;
+
+/*!
+ Sets the coupon code associated with the product. This field is usually not used with product
+ impressions.
+ */
+- (GAIEcommerceProduct *)setCouponCode:(NSString *)productCouponCode;
+
+/*!
+ Sets the position of the product on the screen/product impression list, etc.
+ */
+- (GAIEcommerceProduct *)setPosition:(NSNumber *)productPosition;
+
+/*!
+ Sets the custom dimension associated with this product.
+ */
+- (GAIEcommerceProduct *)setCustomDimension:(NSUInteger)index value:(NSString *)value;
+
+/*!
+ Sets the custom metric associated with this product.
+ */
+- (GAIEcommerceProduct *)setCustomMetric:(NSUInteger)index value:(NSNumber *)value;
+
+/*!
+ Builds an NSDictionary of fields stored in this instance suitable for a product action. The
+ index parameter is the index of this product in the product action list.
+ <br>
+ Normally, users will have no need to call this method.
+ */
+- (NSDictionary *)buildWithIndex:(NSUInteger)index;
+
+/*!
+ Builds an NSDictionary of fields stored in this instance suitable for an impression list. The
+ lIndex parameter is the index of the product impression list while the index parameter is the
+ index of this product in that impression list.
+ <br>
+ Normally, users will have no need to call this method.
+ */
+- (NSDictionary *)buildWithListIndex:(NSUInteger)lIndex index:(NSUInteger)index;
+@end