[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Ecommerce Tracking
This document provides an overview of how to measure in-app payments and
revenue using the Google Analytics SDK v4 for Android.
Overview
Ecommerce measurement allows you to send in-app purchases and
sales to Google Analytics. Ecommerce data in Google Analytics is
comprised of transaction and item hits, related by a shared transaction ID.
Transactions have the following fields:
Field Name
Type
Required
Description
Transaction ID
String
Yes
A unique ID representing the transaction. This ID should not collide
with other transaction IDs.
Affiliation
String
Yes
An entity with which the transaction should be affiliated (e.g. a particular
store)
Revenue
Double
Yes
The total revenue of a transaction, including tax and shipping
Tax
Double
Yes
The total tax for a transaction
Shipping
Double
Yes
The total cost of shipping for a transaction
Currency code
String
No
The local currency of a transaction. Defaults to the currency of the
view (profile) in which the transactions are being viewed.
Items have the following fields:
Field Name
Type
Required
Description
Transaction ID
String
Yes
The transaction ID with which the item should be associated
Name
String
Yes
The name of the product
SKU
String
Yes
The SKU of a product
Category
String
No
A category to which the product belongs
Price
Double
Yes
The price of a product
Quantity
Long
Yes
The quantity of a product
Currency code
String
No
The local currency of a transaction. Defaults to the currency of the
view (profile) in which the transactions are reported
Ecommerce data is used primary in the following standard reports:
Ecommerce Overview
Product Performance
Sales Performance
Transactions
Time to Purchase
Implementation
The TransactionBuilder and ItemBuilder is used to
send transaction and item data to Google Analytics. Each ecommerce field is
set using helper methods. For example:
Ecommerce currency fields support negative currency values, as may be
necessary in the case of refunds or returns.
Specifying Currencies
By default, transaction values are assumed to be in the currency
of the view (profile) in which they are reported.
To override the local currency of a transaction and any associated products,
set the currency code field of the transaction and item hits with the new
currency code. For the complete list of supported currencies and currency
codes, see the
Supported Currencies Reference.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples/Code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]