Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/timonus/tjmixpanellogger
Bare-bones Obj-C Mixpanel logger
https://github.com/timonus/tjmixpanellogger
logger mixpanel objective-c
Last synced: 3 months ago
JSON representation
Bare-bones Obj-C Mixpanel logger
- Host: GitHub
- URL: https://github.com/timonus/tjmixpanellogger
- Owner: timonus
- License: bsd-3-clause
- Created: 2022-11-30T18:10:08.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-02T04:28:39.000Z (12 months ago)
- Last Synced: 2024-03-02T05:28:27.873Z (12 months ago)
- Topics: logger, mixpanel, objective-c
- Language: Objective-C
- Homepage:
- Size: 62.5 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TJMixpanelLogger
`TJMixpanelLogger` is a bare-bones Objective-C [Mixpanel](https://mixpanel.com) logger. It only provides event logging, not user logging or other features that Mixpanel provides.
## Setup & Use
To configure `TJMixpanelLogger`, set its `projectToken` to your Mixpanel project's project token.
```objc
TJMixpanelLogger.projectToken = @"your-token-here";
```If you'd like to use `TJMixpanelLogger` within app extensions, you should also set its `sharedContainerIdentifier` property to an app group identifier.
```objc
TJMixpanelLogger.sharedContainerIdentifier = @"an-app-group-identifier";
```To log an event with `TJMixpanelLogger`, use the `+logEventWithName:properties:` method.
```objc
[TJMixpanelLogger logEventWithName:@"photo_shared"
properties: @{
@"source": @"camera"
@"width": ...
}];
```## Default Event Properties
Events logged using `TJMixpanelLogger` automatically capture the following info.
- A base 64 version of `identifierForVendor` as the install identifier.
- The app version string.
- The OS version.
- The device model.
- The screen dimensions.
- Coarse IP-based location.
- The preferred language.
- For app extensions, the suffix of the extension is included as `bundle_id_suffix`. Apps including extensions will have `bundle_id_suffix=null` for events from the main app.## Other Notes
- This logger supports app extensions (needed for [Opener](https://apps.apple.com/app/id989565871) and [Checkie](https://apps.apple.com/app/id382356167)).
- This logger supports watchOS (needed for [Checkie](https://apps.apple.com/app/id382356167)).
- This logger uses background URL sessions.
- This is the successor to a custom Google Analytics logger I've been using for a while ([very old source snapshot](https://gist.github.com/timonus/2869183a4442e2e70ff9)).