react-native-ensighten

1.0.2 • Public • Published

React Native Ensighten Module

Getting started

$ npm install react-native-ensighten --save

For iOS

cd ios
$ pod install

Special Note: Due to a current issue with Xcode where swift support is not enabled when adding a React Native library using swift code you may need to take the following steps if your build fails (Ignore if you've already added any native swift code to your project):

  • Open the .xcworkspace file in your project's "ios" directory
  • Go to File > New > File...
  • Select "Swift File" and give it any name
  • When prompted select "Add bridging header"
  • Rebuild project

For Android

cd android
$ ./gradlew build

Usage

import Ensighten from 'react-native-ensighten';
 
// In the entry point of your app
Ensighten.bootstap("<account_id>", "<app_id>");

Tracking Page Views

componentDidMount() {
    Ensighten.trackPageView("Product Detail Page", { productId: "12345", productName: "Apple iMac" });
}

Tracking Events

<Button
    title="Add to Cart"
    onPress={() => Ensighten.trackEvent("Add to Cart", { productId: "12345", productName: "Apple iMac" }) };
/>

Tracking Conversions

<Button
    title="Add Promotion to Cart"
    onPress={() => Ensighten.trackEvent("Add Promotion to Cart", { promotionId : "123", promotionName: "Buy an Apple iMac, Get an iPhone 8 50% Off", itemPrice: "$1648.50" }) };
/>

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    2

Package Sidebar

Install

npm i react-native-ensighten

Weekly Downloads

1

Version

1.0.2

License

Proprietary

Unpacked Size

1.3 MB

Total Files

146

Last publish

Collaborators

  • eugene.kolinko