From 0e86bebaff15cd00fb8131f6d553cb507d2f1509 Mon Sep 17 00:00:00 2001 From: Zihe Jia Date: Wed, 28 Jul 2021 00:50:01 -0700 Subject: [PATCH] Update docs --- docs/Mixpanel.html | 206 +++++++++++++++++++++++++++++++++------- docs/MixpanelGroup.html | 14 +-- docs/People.html | 24 ++--- docs/index.html | 49 ++++++---- docs/index.js.html | 21 +++- 5 files changed, 245 insertions(+), 69 deletions(-) diff --git a/docs/Mixpanel.html b/docs/Mixpanel.html index a1ce9fa2..a595cdb9 100644 --- a/docs/Mixpanel.html +++ b/docs/Mixpanel.html @@ -163,10 +163,6 @@

(async, static) -
- Initializes an instance of the API with the given project token. -
- @@ -268,6 +264,15 @@

Parameters:
+
Deprecated:
+ @@ -280,7 +285,7 @@
Parameters:
Source:
@@ -440,7 +445,7 @@
Parameters:
Source:
@@ -607,7 +612,7 @@
Parameters:
Source:
@@ -700,7 +705,7 @@

c
Source:
@@ -862,7 +867,7 @@

Parameters:
Source:
@@ -999,7 +1004,7 @@
Parameters:
Source:
@@ -1115,7 +1120,7 @@

flushSource:
@@ -1211,7 +1216,7 @@

getDisti
Source:
@@ -1394,7 +1399,7 @@

Parameters:
Source:
@@ -1494,7 +1499,7 @@

getPeopleSource:
@@ -1608,7 +1613,7 @@

get
Source:
@@ -1718,7 +1723,7 @@

ha
Source:
@@ -1889,7 +1894,144 @@

Parameters:
Source:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

(async) init(Optional)

+ + + + + + +
+ Initializes Mixpanel +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
Optional + + +boolean + + + + Whether or not Mixpanel can start tracking by default. See optOutTracking()
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
@@ -1979,7 +2121,7 @@

optInTra
Source:
@@ -2071,7 +2213,7 @@

optOutT
Source:
@@ -2218,7 +2360,7 @@

Parameters:
Source:
@@ -2358,7 +2500,7 @@
Parameters:
Source:
@@ -2518,7 +2660,7 @@
Parameters:
Source:
@@ -2607,7 +2749,7 @@

resetSource:
@@ -2767,7 +2909,7 @@
Parameters:
Source:
@@ -2906,7 +3048,7 @@
Parameters:
Source:
@@ -3045,7 +3187,7 @@
Parameters:
Source:
@@ -3185,7 +3327,7 @@
Parameters:
Source:
@@ -3324,7 +3466,7 @@
Parameters:
Source:
@@ -3490,7 +3632,7 @@
Parameters:
Source:
@@ -3679,7 +3821,7 @@
Parameters:
Source:
@@ -3820,7 +3962,7 @@
Parameters:
Source:
@@ -3872,7 +4014,7 @@

Home

Classes

  • diff --git a/docs/MixpanelGroup.html b/docs/MixpanelGroup.html index 78ca5f8c..059c44d3 100644 --- a/docs/MixpanelGroup.html +++ b/docs/MixpanelGroup.html @@ -95,7 +95,7 @@

    new Mixp
    Source:
    @@ -284,7 +284,7 @@

    Parameters:
    Source:
    @@ -446,7 +446,7 @@
    Parameters:
    Source:
    @@ -606,7 +606,7 @@
    Parameters:
    Source:
    @@ -768,7 +768,7 @@
    Parameters:
    Source:
    @@ -905,7 +905,7 @@
    Parameters:
    Source:
    @@ -957,7 +957,7 @@

    Home

    Classes

    • diff --git a/docs/People.html b/docs/People.html index a89ca805..15fc80e1 100644 --- a/docs/People.html +++ b/docs/People.html @@ -100,7 +100,7 @@

      new PeopleSource:
      @@ -289,7 +289,7 @@
      Parameters:
      Source:
      @@ -377,7 +377,7 @@

      clearChar
      Source:
      @@ -468,7 +468,7 @@

      deleteUser<
      Source:
      @@ -630,7 +630,7 @@

      Parameters:
      Source:
      @@ -792,7 +792,7 @@
      Parameters:
      Source:
      @@ -954,7 +954,7 @@
      Parameters:
      Source:
      @@ -1114,7 +1114,7 @@
      Parameters:
      Source:
      @@ -1274,7 +1274,7 @@
      Parameters:
      Source:
      @@ -1436,7 +1436,7 @@
      Parameters:
      Source:
      @@ -1573,7 +1573,7 @@
      Parameters:
      Source:
      @@ -1625,7 +1625,7 @@

      Home

      Classes

    • FAQ
    • @@ -90,23 +91,16 @@

      Steps

      Please note: You do not need to update your Podfile to add Mixpanel. 3. For Xcode 12.5+, there is a known compile issue, please refer to this workaround.

      2. Initialize Mixpanel

      -

      To start tracking with the library you must first initialize with your project token. To initialize the library, first add import { Mixpanel } and call Mixpanel.init(token) with your project token as it's argument.

      +

      To start tracking with the library you must first initialize with your project token. You can get your project token from project settings.

      import { Mixpanel } from 'mixpanel-react-native';
      -...
      -class YourClass extends React.Component {
      -    constructor(props) {
      -        super(props);
      -        this.configMixpanel();
      -    }
      -
      -    configMixpanel = async () => {
      -        this.mixpanel = await Mixpanel.init("Your mixpanel token");
      -    }
      -...
      +
      +const mixpanel = new Mixpanel("Your Project Token");
      +mixpanel.init();
      +
       

      Once you've called this method once, you can access mixpanel throughout the rest of your application.

      3. Send Data

      -

      Let's get started by sending event data. You can send an event from anywhere in your application. Better understand user behavior by storing details that are specific to the event (properties). After initializing the library, Mixpanel will automatically collect common mobile events. You can enable/disable automatic collection through your project settings. Also, Mixpanel automatically tracks some properties by default. learn more

      +

      Let's get started by sending event data. You can send an event from anywhere in your application. Better understand user behavior by storing details that are specific to the event (properties). After initializing the library, Mixpanel will automatically track some properties by default. learn more

      // Track with event-name
       mixpanel.track('Sent Message');
       // Track with event-name and property
      @@ -117,6 +111,29 @@ 

      4. Check for Success

      Open up Live View in Mixpanel to view incoming events. Once data hits our API, it generally takes ~60 seconds for it to be processed, stored, and queryable in your project.

      +

      Complete Code Example

      +
      
      +import React from 'react';
      +import { Button, SafeAreaView } from "react-native";
      +import { Mixpanel } from 'mixpanel-react-native';
      +
      +const mixpanel = new Mixpanel("Your Project Token");
      +mixpanel.init();
      +
      +const SampleApp = () => {
      +  return (
      +    <SafeAreaView>
      +      <Button
      +        title="Select Premium Plan"
      +        onPress={() => mixpanel.track("Plan Selected", {"Plan": "Premium"})}
      +      />
      +    </SafeAreaView>
      +  );
      +}
      +
      +export default SampleApp;
      +
      +

      FAQ

      I want to stop tracking an event/event property in Mixpanel. Is that possible?
      Yes, in Lexicon, you can intercept and drop incoming events or properties. Mixpanel won’t store any new data for the event or property you select to drop. See this article for more information.

      @@ -126,7 +143,7 @@

      FAQ

      To preserve battery life and customer bandwidth, the Mixpanel library doesn't send the events you record immediately. Instead, it sends batches to the Mixpanel servers every 60 seconds while your application is running, as well as when the application transitions to the background. You can call flush() manually if you want to force a flush at a particular moment.

      mixpanel.flush();
       
      -

      If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call setLoggingEnabled to true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.

      +

      If your events are still not showing up after 60 seconds, check if you have opted out of tracking. You can also enable Mixpanel debugging and logging, it allows you to see the debug output from the Mixpanel library. To enable it, call setLoggingEnabled with true, then run your iOS project with Xcode or android project with Android Studio. The logs should be available in the console.

      mixpanel.setLoggingEnabled(true);
       

      Starting with iOS 14.5, do I need to request the user’s permission through the AppTrackingTransparency framework to use Mixpanel?
      @@ -137,7 +154,7 @@

      I want to know more!

      No worries, here are some links that you will find useful:

      Have any questions? Reach out to Mixpanel Support to speak to someone smart, quickly.

      @@ -156,7 +173,7 @@

      Home

      Classes

      • diff --git a/docs/index.js.html b/docs/index.js.html index 0f67f8cc..c5a57e2f 100644 --- a/docs/index.js.html +++ b/docs/index.js.html @@ -79,8 +79,25 @@

        Source: index.js

        } /** - * Initializes an instance of the API with the given project token. + * Initializes Mixpanel + * + * @param {boolean} Optional Whether or not Mixpanel can start tracking by default. See optOutTracking() + * + */ + async init(optOutTrackingDefault = DEFAULT_OPT_OUT) { + let metadata = Helper.getMetaData(); + await MixpanelReactNative.initialize(this.token, optOutTrackingDefault, metadata); + } + + /** + * @deprecated since version 1.3.0. To initialize Mixpanel, please use the instance method `init` instead. See the example below: + * + * <pre><code> + * const mixpanel = new Mixpanel('your project token'); + * mixpanel.init(); + * </code></pre> * + * Initializes Mixpanel and return an instance of Mixpanel the given project token. * * @param {string} token your project token. * @param {boolean} Optional Whether or not Mixpanel can start tracking by default. See optOutTracking() @@ -871,7 +888,7 @@

        Home

        Classes