Page Summary
-
The
Promotionclass is used to construct promotion-related fields for Google Analytics hits. -
It includes constants
ACTION_CLICKandACTION_VIEWto indicate user interaction with a promotion. -
Key methods allow setting the id, name, creative, and position of a promotion for reporting purposes.
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());
Constant Summary
| 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 Constructor Summary
Public Method Summary
| Promotion | |
| Promotion | |
| Promotion | |
| Promotion | |
| String | toString
()
|
Inherited Method Summary
Constants
public static final String ACTION_CLICK
Action to use when the user clicks/taps on a promotion.
public static final String ACTION_VIEW
Action to use when the user views a promotion.
Public Constructors
public Promotion ()
Public Methods
public Promotion setCreative ( String value)
Sets the name of the creative associated with the promotion.
Parameters
Returns
- Returns the same object to enable chaining of methods.
public Promotion setId ( String value)
Sets the id that is used to identify a promotion in GA reports.
Parameters
Returns
- Returns the same object to enable chaining of methods.
public Promotion setName ( String value)
Sets the name that is used to identify the promotion in GA reports.
Parameters
Returns
- Returns the same object to enable chaining of methods.
public Promotion setPosition ( String value)
Sets the position of the promotion.
Parameters
Returns
- Returns the same object to enable chaining of methods.

