java.lang.Object | |
↳ | com.google.android.gms.analytics.ecommerce.Product |
Class to construct product related information for a Google Analytics hit. 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 ProductActions via
addProduct(Product)
and Product
Impressions via
addImpression(Product, String)
.
Typical usage:
ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder(); builder.addImpression( new Product() .setId("PID-1234") .setName("Space Monkeys!") .setPrice(100) .setQuantity(2), "listName"); builder.setProductAction( new ProductAction(ProductAction.ACTION_PURCHASE)) .addProduct(new Product().setId("PID-4321").setName("Water Monkeys!")); tracker.send(builder.build());
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the brand associated with the product in GA reports.
| |||||||||||
Sets the category associated with the product in GA reports.
| |||||||||||
Sets the coupon code associated with the product.
| |||||||||||
Sets the custom dimensions associated with the product.
| |||||||||||
Sets the custom metrics associated with the product.
| |||||||||||
Sets the id that is used to identify a product in GA reports.
| |||||||||||
Sets the name that is used to identify the product in GA reports.
| |||||||||||
Sets the position of the product on the page/product impression list etc.
| |||||||||||
Sets the price of the product.
| |||||||||||
Sets the quantity of the product.
| |||||||||||
Sets the variant of the product.
|
[Expand]
Inherited Methods | |||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Sets the brand associated with the product in GA reports.
value | The product's brand. Example: "Acme Toys" |
---|
Sets the category associated with the product in GA reports.
value | The product's category. Example: "Toys" |
---|
Sets the coupon code associated with the product. This field is usually not used with product impressions.
value | The product's coupon code. Example: "EXTRA10" |
---|
Sets the custom dimensions associated with the product.
index | The dimension's index as configured in Google Analytics Account. Example: 3 |
---|---|
value | The product's custom dimension. Example: "Foo Reseller" |
Sets the custom metrics associated with the product.
index | The metric's index as configured in Google Analytics Account. Example: 4 |
---|---|
value | The product's custom metric. Example: 5 |
Sets the id that is used to identify a product in GA reports.
value | The product id. |
---|
Sets the name that is used to identify the product in GA reports.
value | The product's name. Example: "Space Monkeys" |
---|
Sets the position of the product on the page/product impression list etc.
value | The product's position. Example: 1 or 30 |
---|
Sets the price of the product.
value | The product's price. Example: 3.14 |
---|
Sets the quantity of the product. This field is usually not used with product impressions.
value | The product's quantity. Example: 42 |
---|
Sets the variant of the product.
value | The product's variant. Example: "Yellow" or "Red" |
---|