Giter Club home page Giter Club logo

dash_analytics's Introduction

package:dash_analytics

What's This?

This package is intended to be used on Dash (Flutter, Dart, etc.) related tooling only. It provides APIs to send events to Google Analytics using the Measurement Protocol.

This is not intended to be general purpose or consumed by the community. It is responsible for toggling analytics collection for Dash related tooling on each developer's machine.

Using This Package As A Dash Tool

Refer to the guide.

dash_analytics's People

Contributors

christopherfujino avatar eliasyishak avatar

Watchers

 avatar  avatar

dash_analytics's Issues

Use session data to send users surveys

If a user has analytics enabled and they have not been active on any dash tools, send some kind of survey to understand why, while also highlighting other tooling they may not know about.

Creation of handler class for the configuration file

We want to create a class that can handle all operations dealing with the configuration file that is persisted on the user's computer.

List below of the objectives we want for this class

  • Parse the configuration file into something that can be used within the codebase (#6)
  • Functionality needed to add a new tool that hasn't been configured in the file yet (#7)
  • Method to enable/disable telemetry (#9)
  • Method that can take in a new tool message and show the user the output as well as increment the tool version

Handle configuration file that is not formatted correctly

Need to add some functionality that will be able to read in a config file that has been altered to not follow our assumptions.

Need to handle the cases below:

  • If there were two or more lines for the reporting boolean indicator
  • When there are two more lines for a given tool (ie. if flutter-tools=2022-12-13,1 showed up twice at the bottom of the config file)

Move tools message into package

Originally, I thought that the client (other dash tooling) would be responsible for passing in their own message to show the user about our data collection policy, but really there should be one standard message that is shown to all clients that is controlled by this package. And when there is an update to the messaging, we will update the package version.

Functionality to persist events on client machine sent to GA

Look into adding functionality (can be disabled with flag) that logs all of the events that have been sent on user's computer incase they would like to see what events they are emitting. This will allow them to make an informed decision on whether or not they want to opt in/out of telemetry.

This feature can also enable other use cases – ie. surveying users about inactivity if logs show a decrease in activity over a period of time.

Singleton with setup vs Constructor

Moving our conversation @christopherfujino from the commit to an issue to track better.

The original comment on commit on the lib/src/analytics.dart file: 595be88#diff-8959a2a24fd89be63385a1feffed84beb3be8dab70ec527a4d3dcafc938607f6

Current setup

// Setup the singleton
Analytics.setup(...);

// Can call the singleton like this after
// within different classes, files, etc.
final Analytics analytics = Analytics();
final Analytics analytics2 = Analytics();

If we don't want to use a setup static method before calling for the singleton, we will need to change the design of the package so that the analytics singleton is initialized once and passed down to children where analytics events are passed.

With the current setup we can setup once at the entry point and easily import the package's Analytics class anywhere within the codebase so long as the setup has happened before.

Generate the body for the request

Generate the below items so that we can standardize the events we send

  • Create a Session object that is responsible for creating and extending sessions
  • Use a UserProperty class to store information about the user
  • Create a Google Analytics client class to handle sending events to the POST endpoint

Mock an HTTP Client for Send Event Tests

At the moment, we do not have a fake/mocked http client that we can send the body of the request too. A fake class should be created that returns a Future<Response> type to test sending events

Standardizing events per tool

Discussion from @bwilkerson

It looks like there's a master list of event names to pass into sendEvent. I had assumed that these would be tool-specific, but that appears to not be the case. How are we going to prevent multiple tools from using the same event name for different purposes? Will we use a naming convention, such as 'toolName_eventName'? Or will the tool name and event name be joined automatically so that we don't need to worry about collisions?

Parameters for the base `Analytics(...)` class

Discussion from @bwilkerson

The class Analytics takes several pieces of data, and the example has (presumably) fake values for these. How will I know what the correct values are for these parameters when using the package in production? I could imagine an enum for the tool name, and I think I can figure out how to find the Dart and Flutter version numbers (though if there's a standard way we might want to consider computing them in the analytics package rather than making every client duplicate the code), but it seems like we wouldn't want some of the data to be visible in the source code (like measurementId and apiSecret).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.