diff --git a/README.md b/README.md index 0ee89945..ca86e6d6 100644 --- a/README.md +++ b/README.md @@ -197,23 +197,23 @@ GoogleTagManager.registerFunctionCallTagHandler( - [Examples](#examples-28) - [CustomDimensionsByField](#customdimensionsbyfield) - [Examples](#examples-29) -- [CustomDimensionsByIndex](#customdimensionsbyindex) +- [CustomMetrics](#custommetrics) - [Examples](#examples-30) -- [CustomDimensionsFieldIndexMap](#customdimensionsfieldindexmap) +- [CustomDimensionsByIndex](#customdimensionsbyindex) - [Examples](#examples-31) -- [CustomMetrics](#custommetrics) +- [CustomDimensionsFieldIndexMap](#customdimensionsfieldindexmap) - [Examples](#examples-32) - [DataLayerEvent](#datalayerevent) - [Parameters](#parameters-28) - [Examples](#examples-33) - [ProductActionEnum](#productactionenum) -- [Product](#product) +- [ProductAction](#productaction) - [Parameters](#parameters-29) - [Examples](#examples-34) -- [ProductAction](#productaction) +- [Transaction](#transaction) - [Parameters](#parameters-30) - [Examples](#examples-35) -- [Transaction](#transaction) +- [Product](#product) - [Parameters](#parameters-31) - [Examples](#examples-36) @@ -812,6 +812,17 @@ const customDimensions = { customerType: "Premium", appType: "Beta", credit: 120 tracker.trackScreenView("Home", { customDimensions }); ``` +### CustomMetrics + +A dictionary with custom metric values and their index keys. + +#### Examples + +```javascript +const customMetrics = { 1: 2389, 4: 15000 } +tracker.trackScreenView("Home", { customMetrics }); +``` + ### CustomDimensionsByIndex - **See: CustomDimensionsFieldIndexMap** @@ -847,17 +858,6 @@ tracker.trackScreenView("Home", { customDimensions: { customerType: "Premium" } tracker.trackScreenView("Home", { customDimensions: { 1: "Premium" } }); ``` -### CustomMetrics - -A dictionary with custom metric values and their index keys. - -#### Examples - -```javascript -const customMetrics = { 1: 2389, 4: 15000 } -tracker.trackScreenView("Home", { customMetrics }); -``` - ### DataLayerEvent The Google Tag Manager DataLayerEvent dictionary. @@ -893,38 +893,6 @@ Used by `ProductAction` when describing the type of product action. The possible - Purchase = 7, - Refund = 8 -### Product - -Enhanced Ecommerce Product - -Used by `HitPayload` when populating product actions or impressions - -#### Parameters - -- `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** -- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** -- `category` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) -- `brand` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) -- `variant` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) -- `price` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (Optional) -- `couponCode` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) -- `quantity` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (Optional) - -#### Examples - -```javascript -const product = { - id: "P12345", - name: "Android Warhol T-Shirt", - category: "Apparel/T-Shirts", - brand: "Google", - variant: "Black", - price: 29.2, - quantity: 1, - couponCode: "APPARELSALE" -}; -``` - ### ProductAction Enhanced Ecommerce Product Action @@ -982,3 +950,35 @@ const transaction = { couponCode: "SUMMER2013" }; ``` + +### Product + +Enhanced Ecommerce Product + +Used by `HitPayload` when populating product actions or impressions + +#### Parameters + +- `id` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** +- `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** +- `category` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) +- `brand` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) +- `variant` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) +- `price` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (Optional) +- `couponCode` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (Optional) +- `quantity` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** (Optional) + +#### Examples + +```javascript +const product = { + id: "P12345", + name: "Android Warhol T-Shirt", + category: "Apparel/T-Shirts", + brand: "Google", + variant: "Black", + price: 29.2, + quantity: 1, + couponCode: "APPARELSALE" +}; +``` diff --git a/package.json b/package.json index c73f63cf..1c4b0d9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-google-analytics-bridge", - "version": "6.0.0-rc11", + "version": "6.0.0", "description": "React Native bridge for using native Google Analytics libraries on iOS and Android", "main": "./dist/index.js", "types": "./dist/index.d.ts",