ohitsdaniel / snowplow-flutter-tracker

Snowplow event tracker for Flutter. Add analytics to your Flutter apps and games http://snowplowanalytics.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snowplow Flutter Tracker

pub package

Thank you to Patrik Szabó for his initial work on this library!

Overview

A Flutter plugin that adds analytics to your apps using Snowplow.

With this tracker you can collect event data from your Flutter applications, games or frameworks.

Getting started

Initialize it then call the relevant tracking method:

import 'package:snowplow_flutter_tracker/snowplow_flutter_tracker.dart';

// Initialize it
final emitter = Emitter(uri: 'your-collector-endpoint-url');
final tracker = Tracker(
    emitter: emitter,
    namespace: 'your-namespace',
    appId: 'your-appId',
);
var _tracker = SnowplowFlutterTracker(tracker);
_tracker.initialize();

// Usage
final selfDescribingJson = SelfDescribingJson(
    schema: 'iglu:com.acme/event/jsonschema/1-0-0',
    payload: <String, Object>{'message': 'hello world'},
);
final selfDescribing = SelfDescribing(selfDescribingJson);
_tracker.track(selfDescribing);

Testing Locally

Typlically running a Snowplow server requires deployment on AWS or Google Cloud.

Snowplow Mini is designed to be a simplier version that is easier to deploy or run locally, however it can still be a headache to get it to run locally.

Included in this repository is Snowplow Dummy Server to help solve this problem. This server will simply print requests to the console so you can view the data and ensure your app is configured correctly.

Go to the server directory
cd snowplow_dummy_server

Start the server, which will run on 127.0.0.1:8080
dart bin/main.dart

The example app in this repository hits 127.0.0.1:8080 by default. This works well when using the iOS Simulator. When using a physical device or the Android Emulator, you will need to use a proxy.

Native SDK Versions

Snowplow Android Tracker v1.7.1

Snowplow iOS Tracker v1.6.2

Offical Snowplow Documentation

Basics on Android: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/android-tracker/

Basics on iOS: https://docs.snowplowanalytics.com/docs/collecting-data/collecting-from-own-applications/objective-c-tracker/

Android SDK: https://github.com/snowplow/snowplow-android-tracker

iOS SDK: https://github.com/snowplow/snowplow-objc-tracker

About

Snowplow event tracker for Flutter. Add analytics to your Flutter apps and games http://snowplowanalytics.com

License:MIT License


Languages

Language:Dart 59.7%Language:Kotlin 19.8%Language:Swift 17.4%Language:Ruby 1.9%Language:Objective-C 0.6%Language:Shell 0.6%