Closed ashtynabell closed 5 years ago
Sorry, I'm not very knowledgeable on mixpanel usage.
I'd recommend asking this over on segment for the specific usage of their package.
This only wraps segments package and any specific usage of it and a problem with the specific integration like mixpanel would be better asked in their documtation or customer support.
Thanks, @cfnelson. Quick follow up since you're closing this. Based on your response, I'm assuming that we need a Segment account to fully utilize this package/wrapper of Segment's JS library, Analytics.js.
Is this correct or am I off base?
@ashtynabell Sorry, I can re-open it if you'd like someone from the community to help out, as they may know the answer. You shouldn't need to have a Segment account, or previously you didn't the last I checked. Though I will admit that their documentation and website is quite confusing & misleading around this! But their pkgs are meant to be all open source. And they are just providing a single API interface to interact with multiple different analytic services.
Also the currently bundled analytics.min.js is likely out of date in this pkg.
I would recommend using the npm pkg https://github.com/okgrow/auto-analytics
as you can build your own analytics.min.js file with the specific integrations that you are using. If you go with that approach you will lose the logging of the Meteor sign in as the pkg is agnostic to any framework.
You could copy the code though from here and log it if you wished.
If you're only using mixpanel and not multiple analytic services, I'd recommend using one of the mixpanel pkgs directly, as Segment is bloated and is about 143kb in size (from memory) with just ga & mixpanel. The vendor bundle in this pkg is about 213kb which is even worse! 😅
@ashtynabell To clarify further you should take a look at -> main entry point https://github.com/segmentio/analytics.js & https://github.com/segmentio/analytics.js-core for the core itself, and then you can look at the specific integrations -> https://github.com/segment-integrations?q=analytics.js-integration
Specifically mixpanel is here -> https://github.com/segment-integrations/analytics.js-integration-mixpanel
Two questions here:
Setting People Properties
Is there an analytics equivalent of
mixpanel.people.set
? It seems like theanalytics.identify()
function is what should be used per the Segment docs on identify. However to explicitly set people properties, we need to disable default behavior and add specific properties in Segment settings. But what if we don't have/want a Segment account? How do we accomplish this with this package?Incrementing Events
Same issue here. Incrementing event counts for people properties are done via settings in Segment. Even properties that we may want to increment can only be specified in your Segment settings. How do we properly increment with this package without the need for a Segment account?
Thanks!