npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

segment-cordova-plugin-ng

v4.1.0

Published

Segment Cordova Plugin

Downloads

4

Readme

segment-cordova-plugin

Cordova plugin for Segment mobile SDK

This version of the plugin uses versions 3.7.1 (iOS) and 4.3.1 (Android) of the Segment mobile SDK. You can view Android and iOS SDK sources on Github.

  • https://github.com/segmentio/analytics-android
  • https://github.com/segmentio/analytics-ios

Prerequisites:

  • Segment API keys

Installing

You can install the latest version of the plugin directly from git through the Cordova CLI:

cordova plugin add https://github.com/kohofinancial/segment-cordova-plugin.git

Usage

In your 'deviceready' handler, start Segment Analytics :

window.Segment.startWithConfiguration(IOS_OR_ANDROID_KEY);

To track a Screen :

window.Segment.screen({
    name: 'Home',
    properties: {
        'path': '/home'
    }
});

To track an Event:

window.Segment.track({
    event: 'Order Completed',
    properties: {
        'revenue': 10
    }
});

To track an Identity:

window.Segment.identity({
    userId: 'segment_sdk_user',
    traits: {
        birthday: '2000-01-01'
    }
});

Configuration options for .startWithConfiguration()

You can configure number of options to setup SDK.

trackApplicationLifecycleEvents (Android and iOS)

Record certain application lifecycle events like Application Opened, Application Installed, Application Updated. (Default: false)

recordScreenViews (Android and iOS)

Record screen views automatically. It's not useful for the Cordova PhoneGap app. (Default: false)

defaultOptions (Android and iOS)

Specify which integrations should be enabled or not for all calls. (Default: All)

trackAttributionInformation (Android and iOS)

Record attribution data from enabled providers using the mobile service. (Default: false)

flushQueueSize (Android and iOS)

The queue size at which to flush events. (Default: 20, Max: 250 for Android and 100 for iOS)

enableBrazeIntegration (Android and iOS)

Enable device-mode connection to the Braze destination

collectDeviceId (Android)

Record the device id. (Default: true)

flushInterval (Android)

The interval at which the client should flush events (Default: 30 seconds)

tag (Android)

Key for caching. It's used to share different caches across the instances (Default: "analytics_write_key")

logLevel (Android)

Controls the level of logging (Default: INFO)

shouldUseLocationServices (iOS)

Use location services. (Default: false)

enableAdvertisingTracking (iOS)

Record advertising info. (Default: true)

shouldUseBluetooth (iOS)

Record bluetooth information. (Default: false)

trackInAppPurchases (iOS)

Record in-app purchases from the App Store. (Default: false)

trackPushNotifications (iOS)

Record push notifications. (Default: false)

Example Usage:

window.Segment.startWithConfiguration(IOS_OR_ANDROID_KEY, {
    trackApplicationLifecycleEvents: true,
    trackAttributionInformation: true,
    flushInterval: 60,
    trackInAppPurchases: true,
    enableBrazeIntegration: true
});