csg_journey_hub_sdk 0.0.3 copy "csg_journey_hub_sdk: ^0.0.3" to clipboard
csg_journey_hub_sdk: ^0.0.3 copied to clipboard

Easily track user journey in mobile apps with CSG-Journey Hub SDK. Add plugin to gather info from mobile users & enhance customer experience.

CSG-Journey-Hub-SDK Overview #

  • The CSG-Journey Hub SDK will make it easy to track the user journey throughout the mobile application by enabling customers to add a plugin to their mobile application from which they can gather information from their mobile users.
  • This information can be used for orchestration and analytics purposes.
  • Plugin will be flutter based for android and IOs applications.
  • Plugin has a mechanism to tag individual events, to give the mobile app developer the ability to determine on an event-by-event basis which of them need to be excluded from tracking.
  • Also providing a mechanism where a mobile developer can track the screen views. In the end, this plugin will share the event payload with the described Endpoint.

Installation #

Add the CSGJourneyHubSDk as a dependency to your Flutter application:

flutter pub add csg_journey_hub_sdk

This will add a line with the dependency like this to your pubspec.yaml:

dependencies:
  csg_journey_hub_sdk: <latest-version>

Features in Journey Hub SDK: #

Before you can instrument, you must initialize the SDK using the API key. For example


CSGJourneyHubSDK.initializeApp(
        endpoint: "API_END_POINT", key: "API_KEY", globalParams: {"key": "Value"});

Set event tracking by passing value true #

CSGJourneyHubSDK.setEventTrackingEnabled(true);

Stop event tracking by passing value false #

CSGJourneyHubSDK.setEventTrackingEnabled(false);

Note: By default tracking will be on, unless user set’s it to false

The Journey Hub SDK event tracking: #

This includes tracking events on the mobile application. Additionally, this event tracker also supports the sending of a payload of contextual data. Developers will need to record them by calling a method from the SDK with specific event name and attributes if any.

CSGJourneyHubSDK.logEvent(
        name: "Login Button Clicked",
        requestParams: {"login_event": "Login event.", "event_id": "12151515"});

Global parameters: #

Global parameter is an object with every request, where that object is set once per install. The object should be defined globally and be included with every request (this is in addition to the params object that already exists)

CSGJourneyHubSDK.initializeApp(
        endpoint: API_END_POINT, key: API_KEY, globalParams: {"key": "Value"});

Automatic screen tracking: #

For automatic tracking of screen views the existing flutter application will be using default navigation provided by Flutter SDK. CSGJourneyHubSDK will automatically track your views when supplied as navigatorObservers in your material app. Internally it checks for the name of the route being navigated too on the navigationSetting parameter and logs that as your screen name. Open your main.dart file and add the observer as navigatorObservers.

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "CSGJourneyHubSDK",
      navigatorObservers: [
        CSGJourneyHubSDK.getCSGRouteObserver()
      ],
    );
  }
}

Your view will now be tracked, If, you use named routing, if you don’t then you have to make a small adjustment everywhere you navigate directly to a route. You have to supply the name of the route where you navigate like below.

Navigator.push(
        context,
        MaterialPageRoute(
            builder: (context) => LoginView(),
            settings: RouteSettings(name: LoginView)));

You have to do that for every navigation you do if you’re not using named routing, Once you’ve done that you’ll get all your page views.

Copyright 2023, CSG International, Inc

Licensed under the BSD-2 license. See the LICENSE file for more info.

1
likes
130
pub points
0%
popularity

Publisher

unverified uploader

Easily track user journey in mobile apps with CSG-Journey Hub SDK. Add plugin to gather info from mobile users & enhance customer experience.

Repository (GitLab)
View/report issues

Documentation

API reference

License

BSD-2-Clause (LICENSE)

Dependencies

connectivity_plus, device_info_plus, flutter, flutter_secure_storage, http, path, path_provider, plugin_platform_interface, sqflite_sqlcipher, uuid

More

Packages that depend on csg_journey_hub_sdk