java.lang.Object | |
↳ | com.google.android.gms.analytics.ecommerce.Promotion |
Class to construct promotion related fields for Google Analytics hits. The fields from this class can be used to represent internal promotions that run within an app, such as banners, banner ads etc.
Typical usage:
ScreenViewBuilder builder = new HitBuilders.ScreenViewBuilder(); builder.setPromotionAction(Promotion.ACTION_CLICK) .addPromotion(new Promotion().setId("PROMO-ID1234").setName("Home screen banner.")) tracker.send(builder.build());
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTION_CLICK | Action to use when the user clicks/taps on a promotion. | |||||||||
String | ACTION_VIEW | Action to use when the user views a promotion. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the name of the creative associated with the promotion.
| |||||||||||
Sets the id that is used to identify a promotion in GA reports.
| |||||||||||
Sets the name that is used to identify the promotion in GA reports.
| |||||||||||
Sets the position of the promotion.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Action to use when the user clicks/taps on a promotion.
Action to use when the user views a promotion.
Sets the name of the creative associated with the promotion.
Parameters | |
---|---|
value |
String : The promotion creative's name. Example: "Cool pets creative" |
Returns | |
---|---|
Promotion |
Returns the same object to enable chaining of methods. |
Sets the id that is used to identify a promotion in GA reports.
Parameters | |
---|---|
value |
String : The promotion's id. |
Returns | |
---|---|
Promotion |
Returns the same object to enable chaining of methods. |
Sets the name that is used to identify the promotion in GA reports.
Parameters | |
---|---|
value |
String : The promotion's name. Example: "Home Banner" |
Returns | |
---|---|
Promotion |
Returns the same object to enable chaining of methods. |
Sets the position of the promotion.
Parameters | |
---|---|
value |
String : The promotion's position. Example: "top" or "bottom". |
Returns | |
---|---|
Promotion |
Returns the same object to enable chaining of methods. |
Returns | |
---|---|
String |