react-native-google-analytics-bridge
Advanced tools
Comparing version 4.0.2 to 4.0.3
{ | ||
"name": "react-native-google-analytics-bridge", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "React Native bridge for using native Google Analytics libraries on iOS and Android", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -50,6 +50,6 @@ GoogleAnalyticsBridge [![npm version](https://img.shields.io/npm/v/react-native-google-analytics-bridge.svg)](https://www.npmjs.com/package/react-native-google-analytics-bridge) [![Build Status](https://travis-ci.org/idehub/react-native-google-analytics-bridge.svg?branch=master)](https://travis-ci.org/idehub/react-native-google-analytics-bridge) | ||
// You have access to three classes in this module: | ||
import { | ||
GoogleAnalyticsTracker, | ||
GoogleTagManager, | ||
GoogleAnalyticsSettings | ||
import { | ||
GoogleAnalyticsTracker, | ||
GoogleTagManager, | ||
GoogleAnalyticsSettings | ||
} from 'react-native-google-analytics-bridge'; | ||
@@ -79,3 +79,3 @@ | ||
}); | ||
``` | ||
``` | ||
@@ -98,3 +98,3 @@ ## JavaScript API | ||
Google Analytics expects dimensions to be tracked by indices, and not field names. | ||
Google Analytics expects dimensions to be tracked by indices, and not field names. | ||
To simplify this, you can construct a tracker with a customDimensionsFieldsIndexMap. With this, you can map field names to indices, e.g: | ||
@@ -157,17 +157,17 @@ | ||
* **product (required):** Object | ||
* **id:** String | ||
* **name:** String | ||
* **category:** String | ||
* **brand:** String | ||
* **variant:** String | ||
* **price:** Number | ||
* **quantity:** Number | ||
* **couponCode:** String | ||
* **id (required):** String | ||
* **name (required):** String | ||
* **category (optional):** String | ||
* **brand (optional):** String | ||
* **variant (optional):** String | ||
* **price (optional):** Number | ||
* **quantity (optional):** Number | ||
* **couponCode (optional):** String | ||
* **transaction (required):** Object | ||
* **id:** String | ||
* **affiliation:** String, an entity with which the transaction should be affiliated (e.g. a particular store) | ||
* **revenue:** Number | ||
* **tax:** Number | ||
* **shipping:** Number | ||
* **couponCode:** String | ||
* **id (required):** String | ||
* **affiliation (optional):** String, an entity with which the transaction should be affiliated (e.g. a particular store) | ||
* **revenue (optional):** Number | ||
* **tax (optional):** Number | ||
* **shipping (optional):** Number | ||
* **couponCode (optional):** String | ||
* **eventCategory (required):** String, defaults to "Ecommerce" | ||
@@ -239,3 +239,3 @@ * **eventAction (required):** String, defaults to "Purchase" | ||
couponCode: 'SUMMER2013' | ||
}, | ||
}, | ||
'Ecommerce', | ||
@@ -473,2 +473,2 @@ 'Purchase', | ||
.then((success) => console.log(success)); | ||
``` | ||
``` |
@@ -133,3 +133,3 @@ import { GoogleAnalyticsBridge } from './NativeBridges'; | ||
const formattedCustomDimensions = this.transformCustomDimensionsFieldsToIndexes(customDimensions); | ||
GoogleAnalyticsBridge.trackMultiProductsPurchaseEvent(this.id, products, transaction, eventCategory, eventAction, formattedCustomDimensions); | ||
GoogleAnalyticsBridge.trackMultiProductsPurchaseEventWithCustomDimensionValues(this.id, products, transaction, eventCategory, eventAction, formattedCustomDimensions); | ||
} | ||
@@ -136,0 +136,0 @@ |
@@ -44,4 +44,4 @@ import { GoogleTagManagerBridge } from './NativeBridges'; | ||
static pushDataLayerEvent(dictionary = {}){ | ||
GoogleTagManagerBridge.pushDataLayerEvent(dictionary); | ||
return GoogleTagManagerBridge.pushDataLayerEvent(dictionary); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
35741213
44
917
469