Comments (6)
@vkarpov15 take a look at my module here. https://github.com/tonyxiao/react-native-analytics. it's not an official Segment library yet but I'm happy to help if you run into problems :)
It supports Android as well. And you would use it like so
import Analytics from 'react-native-analytics'
const analytics = Analytics({
writeKey: process.env.SEGMENT_KEY,
skipPageCall: true
})
from analytics.js-core.
@vkarpov15 Have you tried getting in touch with the developers of the react native + segment project at https://github.com/smore-inc/react-native-segment-io-analytics? Unfortunately, I don't think any of us are familiar too deeply with the project yet, but let me check in with the team and see we have any suggestions for you.
from analytics.js-core.
@tonyxiao thanks for the excellent module! I'm unfortunately gonna have to pass though, looking to avoid dealing with native extensions as much as possible because my team doesn't really have anyone who's an expert with both iOS and android dev AFAIK. I ended up settling on hitting the Keen.IO API directly using superagent because keen-js also fails horribly on react native :(
from analytics.js-core.
@vkarpov15 there's actually very strong reason to use native modules on mobile in this case rather than using something like analytics-node
. We do a lot of mobile specific work that we don't do in other SDKs, including but not limited to 1) batching requests and gzipping to save battery and bandwidth (difference here is more than an order of magnitude btw) 2) saving requests to disk when user is offline 3) auto measure key events essential to the mobile user lifecycle (See https://segment.com/blog/native-mobile-spec/) and collect device properties. You can build all of that yourself on top of something like superagent
but it's a ton of work and not easy to get right.
I've shipped a few React Native apps before, it's generally pretty difficult to avoid native modules over time because they are essential for so many core functionalities. You might even have to write one of your own.
from analytics.js-core.
@vkarpov15 just curious, did you try using analytics-node
by the way?
from analytics.js-core.
Nope. I'm sure the module does a lot of useful stuff, but none of what you listed matters to me because right now we're just using keen to track HTTP performance, not user behavior.
from analytics.js-core.
Related Issues (20)
- @segment/cookie not found in npm registery HOT 12
- test
- Allow analytics.js to run without cookies HOT 13
- Is this Library Tree-Shakable? HOT 3
- Instructions for using node module do not work HOT 12
- Instructions are wrong HOT 2
- Compile warning HOT 3
- No types for import SegmentIntegration from "@segment/analytics.js-integration-segmentio"; HOT 3
- No way to determine if anonymousID is set without setting it HOT 2
- Content Security Policy (CSP) rules document HOT 2
- User overrides of 'properties' on '.page' call are not honored HOT 3
- ReDoS Vulnerability HOT 2
- Warn if continue to use shim after real analytics loaded? HOT 2
- Types are an empty object HOT 2
- Broken, missing, and old dependenices HOT 2
- Analytics Node library on the client HOT 2
- Why to revert 4.1.0-4.1.7. Can I still use the code from my fork. HOT 2
- this.analytics = new Analytics(); is not recognized HOT 3
- Vulnerable is-email dependency in 4.1.11 HOT 3
- Udgrade [email protected] to v7 or v8 since it's deprecated
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics.js-core.